Look at my last post
Code:#include <iostream>
#include <iomanip>
using std::cout;
using std::endl;
using std::dec;
int main()
{
int number = 25;
int* pNumber = &number;
cout << endl
<< dec << pNumber << endl;
return EXIT_SUCCESS;
}
Printable View
Look at my last post
Code:#include <iostream>
#include <iomanip>
using std::cout;
using std::endl;
using std::dec;
int main()
{
int number = 25;
int* pNumber = &number;
cout << endl
<< dec << pNumber << endl;
return EXIT_SUCCESS;
}
Your hard-disk is full?
--
Mats
Oh lol,
Well, one drive is full,
In this case, you can probably overcome the problem by setting the environment veriable temp to something else - I usually set it to x:\temp wher x is some drive that has lots of space. You can either restart your dev environment from a command prompt after "set temp=x:\temp" or configure your system settings (My computer -> Properties -> Advanced -> Environment Variables). You may want to set the environment variable "TMP" as well.
--
Mats
Okay thanks,
One more question to ask, prior to the code
the pNumber should return the address in decimal but it doesnt why ?
That's how pointers are displayed. std::dec probably only applies to how real numeric types are output.Quote:
the pNumber should return the address in decimal but it doesnt why ?
To display it as an integer (you don't need std::dec), you'll need a cast:
And lastly an observation: you use cout, endl and dec just once, yet went through all the trouble to type the using directives ... for what? :)Code:reinterpret_cast<int>(pNumber)
On Windows, it's possible to include windows.h and use INT_PTR. It's guaranteed to fit.
Then cast to size_t?