+ 2
Why the system is stopped working
11 Answers
+ 2
https://code.sololearn.com/cu5dwLn7ESQq/?ref=app
+ 2
One example: Int item[n] variable n is not declared.
+ 1
Another example, you use cin to output text. When you should've used cout to output, then cin to input
+ 1
Int item [n] in declared in the loop isn't
For (int i=0;i<n;i++>
+ 1
You declared i in that loop, and even then it is declared after the use of n and isn't even in the same scope.
+ 1
Once again, I suggest taking it slow and starting a new, more comprehensible project. Use new concepts bit by bit instead of smooshing it into one pile of spaghetti code that doesnt even function.
+ 1
I am trying now step by step
One more clearify when I put int item[n] was two variable to declare right
Example
Int n;
Int item;
Like this right and then the loops
+ 1
Well, if you define int n; without any input or definition it will result in n being equal to NULL (I believe), so make sure to do that. Also make sure to make your code more readable by adding comments and indentations. Good luck with your project!
+ 1
https://code.sololearn.com/cF2jx4oe4owi/?ref=app I changed a bunch of the code so it works, you have to input the bar code, and if you want to input multiple bar codes you have to change the itemnum variable in the code. Sorry if it isn't exactly how you wanted it, but of course you can change it to your liking.
0
Wow there are alot things with this. First off use proper indentation, it makes your code much much more readable, second, you are defining are not declaring Char correctly it seems? As it is being read not as a variable but the char keyword, also many variables aren't even declared in your code. Some functions aren't even being used correctly, such as std::cin. I suggest creating an easier first project and taking things slow, try not to implement 20 different things at once if you dont know how to use them correctly. Good luck!
- 1
Char is new function but all other variable is already declared