I'm not exactly familiar with the differences in C++ and visual c++ .net 2003 but the error you are getting sounds and looks like a linker error.
Now because I'm not sure what visual c++ .net 2003 does I'm not sure if you need to declare you main function as an int.
so if you use this code :
#include <iostream>
using namespace std;
int main()
{
int *ptr;
ptr = new int[5];
*ptr = 5;
ptr[1] = 10;
ptr += 2;
*ptr = 15;
ptr -= 2;
for (int i = 0; i < 5; i++)
{
cout << ptr[i] << endl;
}
delete ptr;
return 0;
}
It should work, It does for me, but I'm not using visual c++
Sorry I can't help anymore than this
~ Geo
~ You are unique, just like everyone else
|