I have written following simple solidity code
pragma solidity ^0.4.0;
contract C1 {
function f()
{
g(8) ; // simply passing an integer to another function
}
function g( uint x) returns (uint )
{
uint b = x ;
return b ;
}
}
Now as per my understanding , function g
should have taken 8 as parameter . The value should have been x=8
, thereby equating b also to 8 and function g
returning 8 .
However , I donโt know why but function g
is taking paramter from me i.e. user instead of taking 8 .
Now I know I did not added public/view/pure etc , but I am a newbie in solidity and adding those also did not chaged anything. I tried it and so for simplification I removed it here.
Can anyone please tell me what is wrong here ?