473,545 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Class 1: So You Wanna Learn Programming... (In C++)

Banfa
9,065 Recognized Expert Moderator Expert
Posted by Ganon11

So, you want to learn how to program! Good for you! Programming is a very intruiging and fun activity to pick up, and it's also a great career choice if you like it! Finally, it can be a great brain teaser-type activity, as you challenge yourself with creative and difficult problems!

But there's a problem.

What I'm typing in right now is English. It's cool, it lets you understand what I'm saying, and we've spoken English all our lives. What I'm GOING to be writing in, however, could be called another language entirely. It's what I (rather uncreatively) call Computer-Talk. You would have no trouble understanding the sentence, "Today I took a walk in the park." But try your hand at understanding, "Access the value at position i of myArray to initialize your variable."

Huh?

Fortunately, we won't be dealing with anything this weird for a while. Until then, I'm going to be teaching you a little bit about the basics of Computer-Talk - easy things that you may have heard of before, like Variables, or Input. I'm also going to show you a few things that we see in English class or Math class, but mean completely different things when programming. So let's get started!

The very first vocabulary words we have to learn about are the basics of any language. You have to know what I'm talking about when I ask you to write some programs. Writing programs is called coding, since we are writing code that the computer will be able to understand. Once we finish our beautiful programs, we have to turn them into something the computer can understand. In order to do this, we use a compiler. A compiler can also be a program that helps you to code. For example, I use Bloodshed Dev C++. Not only does this let me compile and run my programs, but it will recognize certain keywords and highlight, change color, or embold them so that I can see important things more easily. This type of compiler is called an Integrated Design Environment, or IDE, because it is an environment that is friendly to us while we design our program. Cool, yeah?

All right, down to some hardcore programming terms. The most important thing to learn for a beginner is input and output. When you ask the user (that's whoever will be running your finished program) for some value that will change the way your program runs, that's called input. In other words, the user is inputting a value. For example, suppose you made a guessing game in which your program generates a random number and the user tries to guess it. Well, in order to do this, you need to be able to get the value, right? Right. That's input.

Output is even simpler. Any program you run has results. You click a button: something appears on the screen. You move: it plays a sound. The moniter and speakers are both output devices - they are a way for the computer to communicate with you. Our output will be very simple, consisting mainly of words appearing in a text box, but it is still vital. Output will help you to determine what your program does. For example, in the guessing game, your program needs to tell the user if they have guessed the number or not. It wouldn't be a very good program if you didn't let the user know if they won, would it? Output can also be used to determine where your program is NOT working (God forbid!). By placing output statements in critical points, you, the programmer, can say, "All right, I expected this value to be this, but instead it's this. This must have gone wrong," and so on.

The final word on our list of basics is syntax. In English, syntax means "the study of the patterns of formation of sentences and phrases from words." (http://dictionary.reference.com/browse/syntax) For example, I type in a very straightforward manner. But consider Yoda, who would say, "In a very straightforward manner type I." The difference in our speaking style is in syntax. Syntax has a similar meaning in programming. In order for the computer to understand what you type, you have to follow certain rules. These rules will become evident as we learn some real programming terms.

Well, now you know what I mean when I say, "Compile your program and tell me the output." You also know what I mean when I say, "Ask the user for input." But you still don't know any real programming! That will come next time, when I show you the most basic of all programs - Hello World!
Dec 5 '06 #1
7 5985
aminulsumon
5 New Member
Banfa,
Nice article. Now i am looking forward little bit more. I know basics of C and C++(OOP). But i like to start professional projects using C and C++. Where from and how shall i start? Would you please help me to build my Dream. Be a C or C++ Professional Programmer. More specifically build myself as professional developer using C/C++.
Dec 25 '07 #2
yughandhar
4 New Member
please written the programmes to understand the listeners (freshers)
Dec 26 '07 #3
yughandhar
4 New Member
thank for resistration
Dec 26 '07 #4
yughandhar
4 New Member
please send reply to me sir............ ............... ............... .......
Dec 26 '07 #5
yughandhar
4 New Member
thyank u sir............ ............... ............... ............... ......
any way good night sir............ ............... ..............
Dec 26 '07 #6
gnita53
1 New Member
So far it is great. What I'm looking for however, is how to make the columns in the start/programs smaller. In my windows, the first one is so large, it won't let some of the others show in the screen.
Jan 4 '08 #7
Som sothea
1 New Member
Cam you tell me How to make the text color I alway make a mistake all time .
Can i have some form of c++? like syntax .
thank you
Jan 11 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

9
1646
by: Eric | last post by:
I have a few questions: 1. Should I learn C first or VB? 2. Should I get a book or learn from websites? 3. What book or which website is best? 4. Or should I take a course?
7
2612
by: | last post by:
1) Downloading sample code and playing with it? 2) Reading books and trying to follow them? Any other ideas? I have always wanted to learn programming, just don't know hot to go about it. Thanks
12
2241
by: Harry | last post by:
Hi, I am a system administrator who wants to move to Web App. development. I have read quite a lot articles regarding .net framework and visual studio.net and feel comfortable to start learning coding. I have inclination towards c#. I know a little bit about c programming. What resource would you suggest to start with(please know that I am...
14
2882
by: GUSTAVO V. P. | last post by:
Hello, my name is Gustavo and I want to know: What one needs to be a good programmer of computers? Which your advice are to be a good programmer? How is the logic acquired? Is it true that people that are good in mathematics are made easier the programming of Computers, for the logic? Is it Visual Basic. Net the language easier of learning?...
0
923
by: pedaammulu | last post by:
Learn how to develop your own ACCOUNTING software. (Inventory Module Included) All professionals, Take Note. Start your own firm or quickly get a job in a MNC, and start earning from today. Announcing "Application Series" of Books for the ERP Domain. Benefits of these books: 1. Become an Expert in Programming in a fortnight.
1
2883
by: cpaprogrammer | last post by:
I'm an accountant by trade and want to learn programming on my own time. I am interested in learning about databases and scripting so that I can utilize these skills in data collection for my practice and clients.
0
7478
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7410
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7923
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7437
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7773
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5343
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3466
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
722
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.