C Programming and Computer Geeks: online c training

Search MY Blog

Showing posts with label online c training. Show all posts
Showing posts with label online c training. Show all posts

Tuesday, 24 December 2013

C Language Advantages



Advantages
Ø  C language is a base or building block for many other currently known languages.

Ø  C language has varieties of data types and powerful operators. Due to this, programs written in C language are efficient, fast and easy to understand.


Ø  C is highly portable language. C programs written for one computer can easily run on another computer without any change or by doing a little change.

Ø  There are only 32 keywords in ANSI C and its strength lies in its built in functions. Several standard functions are available for developing programs.


Ø  Another important advantage of C language is its ability to extend itself.
A C program is basically a collection of functions that are supported by the C library this makes us easier to add our own functions to C library. Due to the availability of large number of functions, the programming task becomes simple.

Ø  C Programming is a structured programming language. This makes developers to think of a problem in terms of function modules or blocks. The Collection of these modules makes a complete program or software. This modular structure makes program debugging, testing and maintenance more easier.

C Language Advantages over C++
C vs C++


Disadvantages

Ø  There is no runtime checking in C language.
Ø  There is no strict type checking. For example, we can pass an integer value for the floating or character data type.
Ø  C does not have concept of OOPs, that’s why C++ is developed.
Ø  C does not have the concept of namespace.

Ø  C does not have the concept of constructor or destructor.

Monday, 23 December 2013

What is "void" type in C/C++ ?


Before going to the void data type, First let us understand the data type concept.
In C/C++ programming language, the data types refer to an extensive system used for declaring/defining variables/objects or functions of different types. The type of a variable determines how much memory space it occupies in storage and how the bit pattern stored is interpreted.
char, int, float, double, void etc.. are some of the data types in C language.
Data types in C/C++
Data Types in C/C++

Now coming to the void data type..
void is basically a keyword to use as a placeholder where you would put a data type, to represent "no data".
void actually refers to an object that does not have a value of any type.

When "void" type is used in function definition it means that function will not return any value.

When "void" is used with pointer type variable declaration eg: void* a or void* b etc. It means any empty type i.e. later in the program you can point any data type(int or float type variable) to a or b respectively.


Click here for more C Tutorials and Concepts.

Thursday, 19 December 2013

String to Integer conversion function


int strtoint(char str[])
{
  int i=0,num=0;
    
  while (str[i]!='\0')
  {
     num=num*10+str[i]-'0';
     i++;
  }

  printf("Entered String = \"%s\" , After String to Int = %d",str, num);

  return num;
}

Output:

String to Integer Conversion
string to integer

 
Click here for more C Faq

Search This Blog