My university professor has given me this project "Simple C++ interpreter". Here are some challenges with pointers that I solved them all. But now, my major problem is with understanding the written code and calling appropriate functions. For example:
int *p=new int; *p = *p+1;
I'm now trying to do so by using nested ifs. But my feelings say, it's not the right way. Can anyone tell me the other ways?
I write here the sample code:
int *p=new int; int *q=Null; int *r=q; *p=5+3; *p=*p+1; r=new int; cout<<*p; r=p; *r=*r+*p; cout<<*p; cout<<5; r=Null; int *s=q; s=new int; *s=7+*p; cout<<*s; *s=*p; cout<<*s;This message most be displayed on the console:
9 18 5 25 18
Programming language was arbitrary and I chose C#.


Sign In
Create Account

Back to top









