6 replies
by ram_cv
Hi,
From what I could deduce from your question, I have given a possible solution. Let me know if you have any queries.
int func(int i, int &j)
{
//Getting the 3rd, 4th and 5th digits of the integer j
int k = (j/100000)%1000;
//Comparing with i
if (k==i)
{
//If they are same then clearing j
j = 0;
}
else
{
//On error beep out.
cout << "\a";
}
return i;
}
by cflarida
It look close but this is what I'm getting for an error.
I will bump up the point 200 more.
C:\Program Files\Microsoft Visual Studio\MyProjects\verify\verify.cpp(15) : error C2065: 'cout' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\verify\verify.cpp(15) : error C2297: '<<' : illegal, right operand has type 'char [2]'
Error executing cl.exe.
by cflarida
by ram_cv
You just have to include to remove that error.
Cheers!
Ram
by cflarida
How sould I be creating the new project because I'm getting an error when I go to run, no errors when I compile.
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/verify2.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
by dsr28
Ok, try this:
int func(int i, int &j)
{
//Getting the 3rd, 4th and 5th digits of the integer j
int k = (j/100000)%1000;
//Comparing with i
if (k==i)
{
//If they are same then clearing j
j = 0;
}
else
{
//On error beep out.
cout << "\a";
}
return i;
}
void main(int argc, char *argv[])
{
func( 444, 1234567890 );
}
Don't forget to change the numbers to what you want!
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending