Here is my problem, I need to make a char array with 20 spots called Name, in the code below I have done this, but its not working correctly and I cant get my compiler to get it to run any other way when it prints its all messed up. Can someone show me where I am going wrong? Also for the float variable GPA it works if i input 4.3, but if I input 4.0, it drops the decimal and zero and prints just a 4. here is my code
Hi, for the first problem with the character array, I think you would have to change it in the code's initialization from 'jonas'; to 'j', 'o', 'n', 'a', 's'; But in the user input when the program is running, it should work correctly.
As for the decimal problem, just add #include <iomanip> at the top, and use the fixed and setprecision(1) manipulators right before it cout's the value for the GPA.
I used the showpoint command. But as for the char array problem, I tried that before and I get a bunch of odd characters displayed, but when it runs the second time it works. so clearly the problem is with the definition part, I am still trying to get to work. Can anybody tell me why i cannot define this char array?