#include <iostream>
usingnamespace std;
int main()
{
int *ip, a;
double *fp, b;
char *cptr, c;
cout << "Enter an integer: ";
cin >> a;
cout << "\nEnter a double: ";
cin >> b;
cout << "\nEnter a character: ";
cin >> c;
ip = newint;
*ip = a;
fp = newdouble;
*fp = b;
cptr = newchar;
*cptr = c;
*(++ip);
cout << "\n\n\nThe new integer is: " << *ip << "\n";
cout << "The new double is: " << *fp+1 << "\n";
*cptr = *cptr+1;
cout << "The new character is: " << *cptr << "\n";
cout << "\n\n\n\n\n\n\t\t\t";
system ("pause");
return 0;
}
1 2 3 4 5 6 7 8
OUTPUT:
Enter an integer: 2
Enter a double: 6.2
Enter a character: z
The new integer is: -33686019 //this is what I see that's wrong with output
The newdouble is:7.2
The new character is::{
*(++ip) means that ip will point at a different adress that u have not assigned. What u want to do is (*ip)++; which will increase the object ip points to by 1.