Is there any errors in these statments?

January 2, 2011 at 06:36:30
Specs: Windows Vista
a.
int *number;
cout<<number<<endl;
b.
double *realPtr;
long *integerPtr;
integerPtr=realPtr;
c.
int *x,y;
x=y;
d.
char s []=" this is a character array ";
for( ; *s != '\0' ; s++)
cout<<*s<<' ';
e.
short *numPtr,result;
void *genericPtr=numPtr;
result = *genericPtr +7;
f.
double x =19.34;
double xPtr =&x;
cout<<xPtr<<endl;

See More: Is there any errors in these statments?

Report •


#1
January 2, 2011 at 07:12:59
Would you at least attempt to do your own homework?

Answering those questions will actually teach you a lot about pointers.

I suggest that you either read the course material or perhaps read an online tutorial


Report •

#2
January 2, 2011 at 07:24:40
OK I'll thanks for the advice
By the way it is not a homework :p

Report •

#3
January 2, 2011 at 07:49:29
Sorry, it just really looks like homework, which is actually quite a common problem in this forum.

My guess is that half of it won't even compile, so I'd say there are errors in those statements.


Report •

Related Solutions

#4
January 2, 2011 at 08:32:37
Yeah right we are here to help each other not to do our homeworks
and I'm not asking for an answer I'm asking for an explain to do it by myself :)

Report •

#5
January 2, 2011 at 09:37:08
There are several errors in those statements. To find out what they are, try compiling code that contains them - the compiler will point out many of the errors. Also, read a good book about C/C++.

Very strange questions to come up with out of the blue. I'd agree with Judago, it looks just like homework. So, just as a matter of interest, how did you come up with these particular questions?


Report •

#6
January 2, 2011 at 10:11:35
Understood

thanks a lot


Report •

Ask Question