0

Help the error states:
.cpp(31) : error C2337: 'count' : attribute not found
referring to new[count] = value; as the problem.

My code is the following:

int main()
{
 int size = 20;
 new double[size]; 


 for(int count = 0; count <= size; count++)
 {
	 int value;
	 cout << "Enter a value for element #" << count << " : ";
	 cin >> value;
	 new[count] = value;	
 }
return 0;
}
1
Contributor
1
Reply
2
Views
9 Years
Discussion Span
Last Post by QuantNeeds
0

Solved it my self lol, but for the sake of others in the same silly situation, the solution:

int size = 20;
 double * numList = new double[size]; 


 for(int count = 0; count <= size; count++)
 {
	 int value;
	 cout << "Enter a value for element #" << count << " : ";
	 cin >> value;
	 numList[count] = value;
 }
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.