If i include <string> and do the 'using namespace std' thing, to declare a string can i simply do this?
string myString;
int main(){
myString = "Duck";
myString = "Goose";
}
Does that code look leagal? Also, is there a way to retrieve one char of a string? I dont know if this would work...
myChar = myString[3];
Are strings good to use, or would a vector of chars be better for text manipulation.
Thanks
string myString;
int main(){
myString = "Duck";
myString = "Goose";
}
Does that code look leagal? Also, is there a way to retrieve one char of a string? I dont know if this would work...
myChar = myString[3];
Are strings good to use, or would a vector of chars be better for text manipulation.
Thanks