C++ questions!

V

victor_05200

#include<iostream>
int mail
{
int*i_ptr,i,m_ptr,m;
i_ptr =&i;
m_ptr=&m;
}


can some one help me amelioration and achieve ???

TESTing...

sorry about bad english, help me thanks!!!
 
J

jalina

(e-mail address removed) a écrit :
#include<iostream>
int mail
{
int*i_ptr,i,m_ptr,m;
i_ptr =&i;
m_ptr=&m;
}


can some one help me amelioration and achieve ???

TESTing...

sorry about bad english, help me thanks!!!
int
main(char **args)
{
int *i_ptr, i, *m_ptr, m;
i_ptr = &i;
m_ptr = &m;
}
 
M

Michael DOUBEZ

jalina a écrit :
(e-mail address removed) a écrit :
int
main(char **args)
{
int *i_ptr, i, *m_ptr, m;
i_ptr = &i;
m_ptr = &m;
}
In what language is that ?


C++ non obfuscated version is:
int main(int argc, const char* argv[])
{
int i;
int* i_ptr=&i;
int m;
int* m_ptr=&m;
}

Michael
 
J

Juha Nieminen

Michael said:
C++ non obfuscated version is:
int main(int argc, const char* argv[])

Why do you need to define argc and argv when they are not used in the
code?
 
M

Michael DOUBEZ

Juha Nieminen a écrit :
Michael said:
C++ non obfuscated version is:
int main(int argc, const char* argv[])

Why do you need to define argc and argv when they are not used in the
code?

The locals are not used either but I kept them. And I have added argc,
argv to correct jalina's args use.

Michael
 
J

James Kanze

int main(int argc, const char* argv[])

Just a nit, but that's not a standard declaration for main.
You're compiler may support it, but it's not required to.

There are only two standard declarations for main:
int main()
and
int main( int argc, char** argv )

Note that for historical reasons, these declarations are not
const correct. The const correct version for the second would
be:
int main( int argc, char* const* argv )
(and don't ask me for a rationale for that---it's just what the
C standard says).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,184
Messages
2,570,973
Members
47,529
Latest member
JaclynShum

Latest Threads

Top