Jump to content
  • Advertisement
Sign in to follow this  
Chocrates

string troubles

This topic is 4081 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

im having troubles getting the individual letter of an array of chars to print out include <iostream> using namespace std; int main() { char input[1001]; int ascii[1001]; cout << "---->Basic Ascii Decoder<----\n"; cin.get(); cout << "Please input the text to be decoded now\n"; cin.getline( input, 1001, '\n');//getting their text cin.ignore(); for (int i =0; i < 1000; i++)//for loop { //ascii = toascii(input);//commented out becuase i was having problems cout << input + "\n";//this is just here to test if i am getting the string correctly, which i am not } return 0; } i eventually want to get the ascii values of them but first things first

Share this post


Link to post
Share on other sites
Advertisement
What do you think input + "\n" means? Why?

(Hint: what is the *type* of input? And of "\n"?)

Share this post


Link to post
Share on other sites
thanks i ended up playing around with it some more and got it working
the reason im not using std::strings is because ive forgotten how, i gave up on c for a while and am having to relearn stuff

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!