-->

Sunday, December 21, 2014

How many error occurs in C language ?

There are three types of errors that may occur while developing or writing C program. There errors are:

1.Syntax Errors
2.Logical Errors
3. Runtime Errors

Syntax Errors:-
The set of rules (grammatical rules) of a programming language for writing statements of the computer program is known as syntax of the language. The program statements are written strictly according to these rules.

Syntax error occur when syntax of a programming language are not followed in writing the source code. The compiler detects these errors at compiling time of source code. The compiler reports a proper error message about the error.

Sunday, December 14, 2014

Why Programmer/Developer need to know about dangiling pointer and memory leak?


Answer:

Pointer helps to create user defined scope to a variable, which is called Dynamic variable. Dynamic Variable can be single variable or group of variable of same type (array) or group of variable of different types (struct). Default local variable scope starts when control enters into a function and ends when control comes out of that function. Default global vairable scope starts at program execution and ends once program finishes.

But scope of a dynamic variable which holds by a pointer can start and end at any point in a program execution, which has to be decided by a programmer. Dangling and memory leak comes into picture only if a programmer doesnt handle the end of scope.



Receive Our Quality Tutorials Straight In Your Inbox By Submitting Your Email ID Below...

Your Information Will Never Be Shared.