C++ Programing help: Consider the following code. What would be the output of th
ID: 3859757 • Letter: C
Question
C++ Programing help: Consider the following code. What would be the output of the program?
#include <iostream>
#include <string>
using namespace std;
typedef struct
{
char szFirstName[16];
char szLastName[16];
char szMiddleName[16];
int nAge;
} CONTACT;
int main(int argc, char *argv[], char *envp[])
{
char szBuffer[1024];
CONTACT * pContact = (CONTACT *)1000;
pContact++;
sprintf_s(szBuffer, sizeof(szBuffer), "Address: 0x%08X", (long)pContact);
cout << szBuffer << endl;
return 0;
}
Explanation / Answer
The above program is comes with an error message
i.e
output: