0

Expected primary expression. j* = 10; ^ enter image description here

$ truffle migrate Error parsing C:\Users\Welcome\Downloads\ethereum-dapp\contracts\Integers.sol: ParsedContract.sol:29:16: ParserError: Expected primary expression. j* = 10; ^ Compilation failed. See above.

  • function parseInt(string _value) public returns (uint _ret) { bytes memory _bytesValue = bytes(_value); uint j = 1; for(uint i = _bytesValue.length-1; i >= 0 && i < _bytesValue.length; i--) { assert(_bytesValue[i] >= 48 && _bytesValue[i] <= 57); _ret += (uint(_bytesValue[i]) - 48)*j; j* = 10; this is my contract – bhemeswararao ankireddy Nov 16 '18 at 18:14
  • Can you edit and put the code in the main question? With formatting. – Xavier Leprêtre B9lab Nov 16 '18 at 18:39
  • Would this be better j *= 10;? – Xavier Leprêtre B9lab Nov 16 '18 at 18:40
1

You've given space between '*' and '=' in j* = 10; , it's like this:

    j *= 10;

Good Luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.