cin >> buf2; // with a /* at the end
I need to put a /* at the end of a cin input. how do i do this?
Its for a directory...I enter c:/users and the i need to append /* to the end to get c:/users/*
cin >> buf2; // with a /* at the end
I need to put a /* at the end of a cin input. how do i do this?
Its for a directory...I enter c:/users and the i need to append /* to the end to get c:/users/*
i think i can use STRCAT
nevermind i got it with s
You definitely should NOT be using strcat. You should be reading in a C++ string (std::string), not a C-string (char buf[...]). After that, you can simply add it by saying either:
Though in this case, you should probably also check to make sure the last character is a '/' if that's a requirement, and if not, append that as well.Code:buf2 += '*'; buf2.append('*');