Monday, 19 January 2015

strucrure and keywords of c language.


This blog inform you about the general structure and keywords of C language.

   C program basically has the following form:
  • Preprocessor Commands
  • Functions
  • Variables
  • Statements & Expressions
  • Comments

The following program is written in the C programming language:
#include <stdio.h> 
 int main()
 { /* My first program */ 
 printf("Hello, World! \n"); 
 return 0; 
Preprocessor Commands: These commands tells the compiler to do preprocessing before doing actual compilation. Like #include <stdio.h> is a preprocessor command which tells a C compiler to include stdio.h file before going to actual compilation. You will learn more about C Preprocessors in C Preprocessors session.

Functions: are main building blocks of any C Program. Every C Program will have one or more functions and there is one mandatory function which is called main() function. This function is prefixed with keyword int which means this function returns an integer value when it exits. This integer value is returned using return statement.
The C Programming language provides a set of built-in functions. In the above example printf() is a C built-in function which is used to print anything on the screen. Check Builtin function section for more detail.
 You will learn how to write your own functions and use them in Using Function session.

Variables: are used to hold numbers, strings and complex data for manipulation. You will learn in detail about variables in C Variable Types.
 
Statements & Expressions : Expressions combine variables and constants to create new values. Statements are expressions, assignments, function calls, or control flow statements which make up C programs.
Comments: are used to give additional useful information inside a C Program. All the comments will be put inside /*...*/ as given in the example above. A comment can span through multiple lines.

      Note the followings
  • C is a case sensitive programming language.
  •  It means in C printf and Printf will have different meanings. 
  • End of each C statement must be marked with a semicolon.
  •   Multiple statements can be one the same line.  
  • White Spaces (ie tab space and space bar ) are ignored. Statements can continue over multiple lines.

Saturday, 17 January 2015

installtion for cand c++

Hello friends,
   
    I , Siddhi Viradiya presenting  my first blog on introduction to C language.
     
 "Introduction to c"

The C is a general-purpose,procedural,structured,machine-
 independent  programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system.It allow the software developers to develop programs with out worrying about the hardware platforms where they will be implemented.The C has now become a widely used professional language for various reasons. 
 
  • Easy to learn
  • Structured language
  •  programs written in c are efficient and fast. 
  • highly portable (written for one computer can be run on another with title or no modification).  
  • having rich set of built in functions and operators that can be used for write any  kind of complex program.
  • Provide variety of data types and powerful operators. 
  •  another important feature of c is its ability to extend  it self  (we can continuously add or down functions to c library).
Before starting  C programming, make sure  we have one text editor in place and we  have enough experience to write a computer program, save(write the code) it in a file, compile it and finally execute(run) it.
The code written in source file is the human readable source for your program. It needs to be "compiled", to turn into machine language so that CPU can actually execute the program as per instructions given.So, we need a one C language compiler for write,compile and run the any kind of C program.At these level knowledge of compiler is enough for us.
Most frequently used and free available compiler is GNU C/C++compiler,otherwise you can use different C compiler like turbo C/C++ compiler.These compilers works for both C and C++ programming languages. 

Further details for set the environmental setup of C/C++ is following:

Prefer the following links for installation of  compiler:
http://www.mingw.org/wiki/Getting_Started 
https://www.youtube.com/watch?v=z6SKatxfCOg 
https://www.youtube.com/watch?v=1N-g-Xvw3CM 

To download notepad++ :
http://notepad-plus-plus.org/download/v6.7.4.html

nowadays code block is widely used for CPP:
http://codeblock.org

some time windows user having the following error: 
 Tiny XML error message: 
Infile:C:\Users\Mike\AppData\Roaming\codeblocks\default.conf
Delete this file when C::B is not running and then re-start C::B.