3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Revised C Language Hello World.

Step 3The Opened Project and Starter Source File

The Opened Project and Starter Source File
Now you should get a window that looks like this screen shot, with a couple of exceptions that I'll tell you about. First, the branches on the project view at the left are probably collapsed on yours. I opened mine, by clicking on it like in a file tree anywhere else. Second, your file branch that is off of the Hello project is still mamed 'main.c'. There are a couple of ways to handle this. Either you can keep different projects in separate folders or you can rename the files to what you called the project. I find that this is what works for me, so I did it here as well.

Now, you should notice right away that the editor window to the right has inserted some code for you, as a start. This is nice, but occasionally annoying. The first thing to do is to select the words in the parentheses, 'int argc, char *argv[]', change that all to the one word, 'void'. The words originally in there are for projects you'll see later that use command line parameters, also called switches. For now, the program can start up and ignore these, so we use the data place holder 'void'. In the C language, functions, even the special main function, expect to be told about what data types are needed to start with and what data type they can return, or bring back as an answer. The 'void' just says, 'nothing' to the compiler (yes, well for our purposes here). You can use the yellow diskette symbol to save at any time.

The next screenshot will show the code below also. And here it is folks:

/* In C on a straight C compiler, this is a comment.
It is in block form, running until closed without
anything else necessary to keep it from harm's way.
Anything in between doesn't affect the compiled
program at all. Not even a little!
*/

#include <stdio.h>
#include <stdlib.h>

int main(void)
{

puts("Hello, World!");

system("PAUSE");

return 0;

}
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
0
Followers
Author:Delta629
Yes.