Can you please explain what this piece of C++ code does:
int main()
{
long * tempArray[10];
}
Thanks for your help!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That particular snippet of code does nothing at all. If you compile that program, it will terminate and report to the hosting environment that it terminated successfully, and that’s it.
The
long * tempArray[10];declares a variable calledtempArrayto have the type array 10 of pointer to long, which means thattempArrayis capable of holding 10long *objects.For demonstrative purposes: