Hello there,
Now before anyone states, yes I know C is outdated, I know C++ is better. However C is a great language to allow beginners into the world of programming!
Anyway, today I will be showing you guys how to output text in C.
First of all you will need a compiler(DevC++ is great, however any other C compiler will work fine).
Now open Notepad(or DevC++) and type out this little ol' script!
Code:
[C Programming]The basics of C!
Some criticism:
Although return looks like a function and many people use it as such, it's not. It doesn't require the brackets.
You do need to return something (an int, it says it before the main() function name) from the main function (the exit code of the program, normally 0 on success and >0 on failure), and by using return(0) you are returning 0 (success). If you didn't return anything, the compiler would probably show a warning message.
I don't think C is outdated or that C++ is better, but for a beginner, I would recommend a higher level language.
Although return looks like a function and many people use it as such, it's not. It doesn't require the brackets.
You do need to return something (an int, it says it before the main() function name) from the main function (the exit code of the program, normally 0 on success and >0 on failure), and by using return(0) you are returning 0 (success). If you didn't return anything, the compiler would probably show a warning message.
I don't think C is outdated or that C++ is better, but for a beginner, I would recommend a higher level language.
It is quite a minimal tutorial however I did find it useful, as for high level languages I recommend Python!
PS: Of course C! is greater than C++
PS: Of course C! is greater than C++
Also you said DevC++ was a compiler, no its an IDE
I know it is an IDE , but for the sake of this tutorial I called it a compiler to reduce the confusion of the beginners. Otherwise I would of have to explain and IDE in detail to stop the beginners from giving up from confusion . Thanks for pointing that out.
If you guys want more C tuts/more advanced C tuts. Then please say
If you guys want more C tuts/more advanced C tuts. Then please say
This is rather simple. C has it's uses, it's great for writing programs that interact with the hardware, like kernels
Yeah, good way to put it Adam
I might add variables and input to next tutorial
xLite
I might add variables and input to next tutorial
xLite
By calling DevC++ is a compiler you are causing more confusion
Personally I'd recommend something like BASIC to people new to programming to help them get to grasp with the concepts of logical programming. It's like learning to run before you can walk.
I guess the tutorial is okay for someone trying to grasp the syntax..
I wouldn't recommend Dev-C++ though. It's outdated now. Use an alternative, such as code::blocks.
http://codeblocks.org
I wouldn't recommend Dev-C++ though. It's outdated now. Use an alternative, such as code::blocks.
http://codeblocks.org
Recovered from /coding-tutorials/11963-c-programming-basics-c.html · captured 2008.