View Single Post
  #4 (permalink)  
Old 11-17-06, 02:52 PM
King Coder King Coder is offline
Community VIP
 
Join Date: Jan 2006
Posts: 703
Thanks: 0
Thanked 0 Times in 0 Posts
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:

Code:
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");
Are you just wanting to print the address of the stack? If so, the '&' can give you the address. For instance:

Code:
int b = 5;
cout << &b << endl;
Will print the address of b

printf will work just as good.
__________________
my site
Reply With Quote