There's something wrong with the line:
Code:int myArray[4] = (1, 2, 3, 4);Code:#include "stdafx.h" #include <iostream> using namespace std; int main() { int myArray[4] = (1, 2, 3, 4); cout << (int)myArray << endl; return 0; }
regards,
The SharK
This is a discussion on What's wrong with this code...? within the C++ Programming forums, part of the General Programming Boards category; There's something wrong with the line: Code: int myArray[4] = (1, 2, 3, 4); Code: #include "stdafx.h" #include <iostream> using ...
There's something wrong with the line:
Code:int myArray[4] = (1, 2, 3, 4);Code:#include "stdafx.h" #include <iostream> using namespace std; int main() { int myArray[4] = (1, 2, 3, 4); cout << (int)myArray << endl; return 0; }
regards,
The SharK
Studying programming languages,
you'll ALWAYS be a student ;-)
Look up the format for an initializer list for an array. You're close, but with C++ it's all in the details.
Also, (int) is an old C-style cast. Use C++ casts.
Use this:
The braces are for the array not these '( )'Code:int myArray[4] = {1, 2, 3, 4};
Hello, testing testing. Everthing is running perfectly...for now
I see, now it works![]()
thanks
The SharK
Studying programming languages,
you'll ALWAYS be a student ;-)