I am having a problem with the program I am trying to code. It\'s just a Windows console program and I am very new to C++. It\'s only my 4th program.
The problem I a
First, int * price;
is a dangling pointer - you never initialize it. You have to do:
int * price = new int[i];
Second, usually, i
denotes an iterator index so I suggest you stick with that - so
for (i=0; i
Third, you need to compare char arrays using strncmp
in your case.
Fourth and most important - use std::string
and std::vector
instead. This is C++, not C.