C Programming for the Complete Newbie
Essay Preview: C Programming for the Complete Newbie
Report this essay
C programming for the complete newbie
Hello there im Krisis you may have seen me on irc.hackersclub.com.
Well I thought it was about time to write an article like everyone else. But
unlike many others
mine wont be on Hacking, Cracking, or Phreaking its on C programming, you
see Im not the best
hacker but Im an ok programmer. So here it goes. This is based for absolute
beginners so those
of you like my friend Chrak wouldn be interested in it.
1st lets talk about some of C s history. C was invent by Dennis Ritchie
and Kenneth
Thompson. They modeled it after the language they were using called B. C
was a subset of B hence
the name. C was made because B was going out of style and they needed a new
language to write
UNIX in. Yes UNIX was made in C. C was made popular very quickly because
every UNIX sold had a C
compiler. A compiler is a program thats looks at your source code and
transfers it into object
code, after it is transferred
into object code it must be linked, once its
linked it can be
executed.
2nd Lets talk about variables they are your integers and characters and so
on. You have
many data types they are.
int integers
char characters
long int bigger integers
short int same as int
float decimal numbers
double even bigger decimal numbers
To define a variable 1st you must put something like int MyNum;
MyNum = 2;
or for a character value it would be like char name; name
= Jim;
notice the \ you must have those around character values, they are not
needed for integers or
decimals.
3rd Ill tell you about stuff like #include and #define. #include is used
to tell the
compiler that whatever is in the brackets just be included like its part of
your code.
#include
#define is used to define something Like the color of a truck or car.
#define TRUCK “red”
#include and #define must come before any functions are even prototyped
(Ill talk about this
later).
4th Ill talk about functions. Every program must have at least one
function. That
functions name must be main(). The () tells the compiler that it is a
function. All functions
must return a value in the main() function a 0 is usually returned. In your
functions you will
want to use comments to explain your code a comment is begun by using /*
and ended by using */ .
I will now show you your 1st program.
#include /* Used in most standard Input Output Programs */
main()
{ /* Beginning Brackets used to show the beginning
a block of code */
printf(“Hello World”); /* A function already written in Stdio.h */
return 0; /* Value returned from the program */
} /* Ending bracket used to show end of a block of code */
now compile your program in your compiler if your using UNIX do it like this
gcc hello.c -o Hello
and then run your program bye typing in ./Hello
5th Ill talk about output which is essential

Get Your Essay

Cite this page

Program Thats And End Of A Block Of Code. (June 17, 2021). Retrieved from https://www.freeessays.education/program-thats-and-end-of-a-block-of-code-essay/