insertIt tells me c was not declared in this scope.. Wut???Code:#include <iostream> #include <fstream> using namespace std; int copii(int a) { int c; c=a%10; return c; }
insertIt tells me c was not declared in this scope.. Wut???Code:#include <iostream> #include <fstream> using namespace std; int copii(int a) { int c; c=a%10; return c; }
If this is the whole program, you're definitely gonna want to have a main as well.
How To Ask Questions The Smart Way
Your program fragment compiles just fine.
You need to copy/paste your code from your editor, and copy/paste the exact error message(s) you get from the compiler.
Random snippets and "wut" doesn't cut it.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
you can try putting a space between characters here - c=a%10 - and for 'c' to return something, should an 'a' have some value?? also check out these sites C Operators: Arithmetic, Logical, Conditional and more, C++ Language - C++ Tutorials, probably over there you can find some answers,
best
Last edited by Salem; 12-06-2016 at 01:50 AM. Reason: removed the homework cheat site.