Question: Can someone please explain to me how I can fix this error I'm getting: error: 's' was note declared int this scope digits[i] = s.length()

Can someone please explain to me how I can fix this error I'm getting:

error: 's' was note declared int this scope

digits[i] = s.length() - '0'; ^

Here is my code:

BigInt::BigInt(string s) { if(s.length() > 100){ cout << "Size can't exceed 100!"; exit(1); } }

int BigInt::getLen() const { int i; for (i = 0; i < 100; i++) { digits[i] = s.length() - '0'; } len = s.length(); return len; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!