Showing posts with label Dennis Ritchie. Show all posts
Showing posts with label Dennis Ritchie. Show all posts

Can we declare static variable Global in C Programming Language?



Can we declare static variable as Global in C Programming Language?

We can declare a static variable as Global and Local. There is some difference between declaring a variable as Global and Local. If we declare a variable as local then it can accessed only with in the function where it is declared in a program.
While if we declare a variable as Global then it can be accessed by all functions with in the program. 

Can static variables be declared in Header file in C Programming Language?


Can static variables be declared in Header file in C Programming Language?


We can not declare a static variable without defining it. We can declare static variables in header file when their definition should also be provided in the same header file. It is generally an idea to use static variables in the header file but it creates some problem that it makes the static variables as a private copy of header file i.e it can not be used elsewhere. 



What is the meaning of Static variable in C Programming Language?


What is the meaning of Static variable in C Programming Language?

A static variable is a variable that has been allocated statically. A local static variable exists for the period of program but it is only visible in the function body. If the function is declared as static the it is invisible to outer files. If we use static global variable in the file then it is limited to with in the file. 

A program in C:-

  • #include <stdio.h>
  • int a = 10;  
  • main()
  • {
  •     int i =0
  •     void fun();
  •     fun();            
  •     printf("After First Call");
  •     fun();            
  •     printf("After Second Call");
  •     fun();            
  •     printf("After Third Call");
  • }
  • void fun()
  • {
  •     static int p=0;  
  •     int q = 10;             
  •     printf("value of p %d q %d",p,q);
  •     p=p+10;
  • }

Out Put of Above Program:-

After First Call:-      p= 0, q=10
After Second Call:- p=10, q=10
After Third Call:-     p=20, q=10


What are the disadvantages of C Language?


What are the disadvantages of C Language?


  • C has not constructor and destructor.
  • C has not the concept of Namespace.
  • C has not strict type checking.
  • C has not runtime checking.
  • C has not concept of Object Oriented Programming. These OOPs features are very important for regarding programming concept.
  • If the programs has large length then it is difficult to fix the bugs.
  • It is procedure oriented programming language, it is major problem.  

What are the advantages of C Language?



What are the advantages of C Language?

  • C is the basic language. It is the basis for development of other programming languages like C++, Java etc.
  • C programs are very fast and efficient then it is the advantage to save programmer's time.
  • C is simple and compact language.
  • C is flexible language so it provides easiness to programmer.
  • C is a portable language. It provides a high portability to take our software to one Operating System to other.
  • C has a lot libraries and these libraries provide easiness to programmers.
  • C is building block for other programming language. 

What are the characteristics of C Language?



What are the characteristics of C Language?

C is very popular language due to it's qualities and characteristics. Some of them are given below:-
  • C is popular for it's modularity characteristics. In it we can divided the large modules to small - 2 modules. It is very important in respect to give easiness to work.
  • Portability is also good characteristic. C language provides the portability. We can take or run our software anywhere due to it's portable nature.
  • C is structured Language.
  • C provides high speed to programmer because it is easy to write.
  • C provides the pointer functionality.
  • C can manage the low level activity.
  • We can compile the C programs in different -2 computers.
  • C provides the flexibility to programmers.
  • We can develop the efficient programs with the help of C.
  • C provides the extensive use of function calls.

Define C Language - What is C ?



What is C Programming Language?


C is a very popular programming language. It is standardized , structured and procedural programming language. 


It is developed by Dennis Ritchie between 1969 to 1973 in the Bell Laboratories. It is developed for use on the Unix Operating System.


Due to it's popularity it is used by many other Operating Systems. So it is one of the most widely used programming languages. 


C is used for writing System Software. It is also used for developing Application Software.