Hey I am following a video tutorial teaching pointers... I am following along and writing what they have. Which is:
#include <iostream>
using namespace std;
void main()
{
int myArray[4] = (1, 2, 3, 4);
cout << (int)myArray << endl;
cout << (int)&myArray[1] << endl;
}
They are able to run this.
Now they are using an older version of Visual C++ than I am.
Here is the error I am getting when I try to run it:
1>------ Build started: Project: HelloWorld, Configuration: Debug Win32 ------
1>Compiling...
1>helloworld.cpp
1>c:\users\--------\documents\visual studio 2008\projects\helloworld\helloworld\helloworld.cpp(7) : error C2440: 'initializing' : cannot convert from 'int' to 'int [4]'
1> There are no conversions to array types, although there are conversions to references or pointers to arrays
1>Build log was saved at "file://c:\Users\--------\Documents\Visual Studio 2008\Projects\HelloWorld\HelloWorld\Debug\BuildLog.htm"
1>HelloWorld - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
How can this be fixed