Quote:
|
Originally Posted by ashali19
Dear expert,
i am sorry for the help i have asked.i have put in effort and was able to do the program in c.However i need to use c++ to do the functions.
Right now i am printing the address in C such that:
printf("\nMy stack looks like:\n%p\n%p\n%p\n%p\n%p\n%p\n%p\n%p\n%p\n%p\n%p\ n%p\n%p\n%p\n%p\n%p\n%p\n%p\n%p\n%p\n%p\n%p\n%p\n% p\n%p\n%p\n");
The above will print the addresses.I need to use C++ to do display the addresses.
cout<<"address arguments";
i have used #include<iostream> but it does not work???is there some other sytax i should use??
rgds
|
cout is right, but I'm not sure what you're wanting with this portion of code:
Are you just wanting to print the address of the stack? If so, the '&' can give you the address. For instance:
Will print the address of b
printf will work just as good.