Hey, I'm a beginner and I need help with my code. Whenever I run the code, it asks me for my student ID like it's supposed to, and once I press enter all the other things that need user input show up at once. Like all the input your grades pop up in the command window.
This is how it looked like before I added the "endl;" at the end of my lines.
char name;
char holds a single character. It cannot possibly hold more than that. So if you enter more than one character for name, excess ones will be read as lastName (a single char too) and then will be passed to double grade which leads to all sort of problems.
#include <string> and use std::string instead of char variables.
char name;
char lastName;
It accept only single character.
char name[20];
char lastName[20];
if you want to enter more than one character ,you need to enter the number of character here char can accept less than 20 character.