Hello, I'm new to Visual C++. I'm trying to make a simple program which calculates the amount of letters in the word, so as I understand I need to find out the size of string. However, neither string.size() nor string.length() seems to work here. Do I have to include something or is everything different here?
1 2 3 4
String^ i;
i=textBox2->Text;
textBox1 -> Text= i;
int a = i.Size();
What do you mean string.size() / string.length() doesn't work? Can you be more specific. If you posted more code I am more likely to be able to assist you better. Do you mean it is not returning the size you expected? Have you tried debugging?
Apparently, I needed to use x -> Length; to get the result I needed. As I said, I'm very new to Visual Studio and pretty new to C++ so I might be wrong somewhere. But if it works then I'm OK with that