C Programming
By: Mike • Study Guide • 1,917 Words • January 17, 2010 • 878 Views
Join now to read essay C Programming
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 it's on C programming, you
see I'm not the best
hacker but I'm an ok programmer. So here it goes. This is based for absolute
beginners so those
of you like my friend Chrak wouldn't 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 it's
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 I'll 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 <stdio.h>
#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
(I'll talk about this
later).
/***************************************************************************
********************/