debankdefi / dappdevnotes Goto Github PK
View Code? Open in Web Editor NEWDAPP开发笔记
DAPP开发笔记
https://github.com/Dappub/DAPPDevNotes/blob/master/DAPP%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0-EOS-20180705.md:
erase
了bet_itr
之后,bet_itr
就不能++
了
获取的是非EOS代币余额可以做到吗?在另一个合约中获取自己部署的另一个合约的代币
@thbourlove
https://github.com/Dappub/DAPPDevNotes/blob/master/DAPP%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0-EOS-20180701.md
我按照您的上面步骤来获取某个账户的余额,
本地EOS环境已经OK,EOS的example也正常通过eoscpp编译生产wast文件。
现在是想通过cpp来获取余额。如下是我简单的代码:
#include <eosio.token/eosio.token.hpp>
#include <eosiolib/eosio.hpp>
auto eos_token = eosio::token(N(eosio.token));
auto balance = eos_token.get_balance('eos.io', symbol_type(S(4, EOS)).name());
print("eos balance:",balance.amount);
然后连接库文件:
ln -s /your eos path/contracts/eosio.token /usr/local/include/
然后编译:
eosiocpp -o account.wast accountbalance.cpp
然后报错:
accountbalance.cpp:4:38: warning: multi-character character constant [-Wmultichar]
auto balance = eos_token.get_balance('eos.io', symbol_type(S(4, EOS)).name());
^
accountbalance.cpp:4:38: warning: character constant too long for its type
accountbalance.cpp:4:48: error: use of undeclared identifier 'symbol_type'
auto balance = eos_token.get_balance('eos.io', symbol_type(S(4, EOS)).name());
^
accountbalance.cpp:5:1: error: C++ requires a type specifier for all declarations
print("eos balance:",balance.amount);
^
2 warnings and 2 errors generated.
请问是哪里的问题呢?
对EOS的编译不是很理解,请帮忙纠正下错误,谢谢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.