Question:
i'm new to c++ and programming in general?
Jamie
2012-08-08 14:40:47 UTC
i am completely new to scripting and programming and one day want to be a computer game programmer and i am just turned 14 right now so i decided to learn c++ the best i could so i got a book off amazon but they delivered the wrong one so now i am learning c and will be going on c++ later.

it was all going very well till i got to the section on getchar and putchar and i just dont understand what it is at all and how it works or how to use it. is says in the book it is something about inputs and outputs so i was wondering is someone could explain please.

thanks
Three answers:
Marcus S
2012-08-08 15:10:32 UTC
Hi. I know your pain because I'm 13 and it was difficult for me to get into C++.



Anyway, IO (Input/Output) is really simple. You have input devices, and you have output devices. Right now, you are using your keyboard as input and your terminal on your computer as output.



getchar() reads the character you type. This is the input. A character is simply one letter, number, or symbol. Such as the letter a, or the symbol %.



putchar() displays a character that you want. Like you can type putchar('d') and it would display the letter d on the terminal. This is output.



Don't worry, you'll get the hang of this stuff. It becomes really simple after awhile.
MavistheMaven
2012-08-08 22:20:32 UTC
I don't know c. I looked at your question because the title said c++. You might want to re-ask this with a question that's clearer, something like "C programming: What are getchar and putchar?" so answerers know whether they can help before they even open the details.



That said, there are many message boards out there for people learning programming. You'll get great help on them. Here's one: http://www.dreamincode.net/forums/forum/15-c-and-c/



Did you think about just sending the C book back to Amazon and making them send you the book you actually ordered? C is okay, but it's not object-oriented, and you'll have to unlearn it when you go to learn C++. If you were an experienced programmer, this would be easier to do, because you'd already know several languages. Personally, I'd get the C++ book. If Amazon made a mistake, they really ought to overnight the correct book, so you wouldn't have long to wait.



You might also be interested in learning Python, which is supposed to be a good first language because it's cleaner and easier than C++ and Java, and gives you the option of using object-oriented code or not. You don't even need a book, as there are some great tutorials on the web (find them at http://www.python.org ).



There are also some free courses on the web taught by professors at top universities, that you can start anytime and go at your own pace. You even get a certificate if you finish these courses. You don't have to be a college student - they are easy enough for a 14-year-old. Check them out on these websites:

http://www.udacity.com/overview/Course/cs101/CourseRev/apr2012 (learn to build a web crawler, start any time)

https://www.coursera.org/course/interactivepython (learn to create some games, but it doesn't start till October)
Michelle A
2012-08-08 22:21:03 UTC
I agree with the explanation Marcus provided. I only want to provide you with another resource that may be of value to you. The New Boston website has hundreds of free video tutorials for several programming languages including C++, Java, VB.NET and tons more. This was a big help for me through school along with MSDN.



Good Luck!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...