You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am new to Eos (iam using jungle Testnet ). i have tried a small contract which given below. adding two number
and result storing in a variable c.after deploying the contract. passing a two argument to contract
function.
how do i access the variable c (which is result). if not is there is any other way to access result.
#include <eosiolib/eosio.hpp>
#include <eosiolib/print.hpp>
using namespace eosio;
class add : public contract
{
public:
uint64_t c;
using contract::contract;
void sum(uint64_t a, uint64_t b)
{
c = a + b;
print("Sum is ",c);
}
void gdata()
{
print(c);
}
};
EOSIO_DISPATCH(add, (sum) (gdata))
The text was updated successfully, but these errors were encountered:
Hi,
I am new to Eos (iam using jungle Testnet ). i have tried a small contract which given below. adding two number
and result storing in a variable c.after deploying the contract. passing a two argument to contract
function.
how do i access the variable c (which is result). if not is there is any other way to access result.
#include <eosiolib/eosio.hpp>
#include <eosiolib/print.hpp>
using namespace eosio;
class add : public contract
{
public:
uint64_t c;
using contract::contract;
void sum(uint64_t a, uint64_t b)
{
c = a + b;
print("Sum is ",c);
}
void gdata()
{
print(c);
}
};
EOSIO_DISPATCH(add, (sum) (gdata))
The text was updated successfully, but these errors were encountered: