I am trying to take a word and only use the first letter, and then after the letter is converted i have another input inquire, but the compiler skips it. my educated guess is that might be because the letters that are after the first letter i took from string are still there. Also is there a better way to convert string to char?
My bad i didn't realize that since it is a long code i only copied and pasted it. I just want to find a way where the user inputs a word and i either convert the string to char or use the first letter but with out causing anything to the code. for example i was testing "rest" but it just skips line 24 which is collecting a int
There is a very easy way to do this but in order to do it there is a library you should have. By any chance, are you using Visual Studio 2015? Knowing this information would be very helpful.
abstractionAnon what should i do instead? use only char since the beginning? I do not want to prompt the user telling them to enter only the first letter, i want them to enter the full word and me take the first letter and ignore or erase the rest.
Sylvagon nope I'm using Xcode, but which library is it? maybe i can find alternatives.
I am unsure of the certain library, however I do know that for me, I use Visual Studio Community 2015, and a library comes pre-installed. The library seems to have been made by microsoft, but I will see if I can find it or alternatives. It could be possible that you do not need to install anything extra, but instead you need to use the namespace: "System". (Yes, the "S" is capital). For me, if I wanted to convert string to char or vise versa, I would use a command using Console::Converto. However that command is in the system namespace. My question is, why do you even have to make it a char? Can you not just keep it as a string?
For example:
1 2 3 4 5 6
//This string will be the string of the first letter of the word
string letter;
if (letter == "R") {
//In here just type what you need
}