Skip to content
Tejsumeru

Thoughts Become Reality

  • Tutorials
  • Video Tutorial
  • Tutorials
  • Video Tutorial
  • Interview Quetions

    What is memory leak? Why it should be avoided.

    December 15, 2019 - By tejsumeru.12@gmail.com

    Memory leak occurs when programmers create a memory in heap and forget to delete it. Memory leaks are particularly serious issues for programs like daemons and servers which by definition never terminate. #include <stdlib.h> void f() { int* ptr = (int*)malloc(sizeof(int)); return; /* Return without freeing ptr*/ }  

    Continue Reading
  • Interview Quetions

    What is Dangling pointer?

    December 15, 2019 - By tejsumeru.12@gmail.com

    Dangling Pointer is a pointer that doesn’t point to a valid memory location. Dangling pointers arise when an object is deleted or deallocated, without modifying the value of the pointer, so that the pointer still points to the memory location of the deallocated memory. Following are examples. int* ptr = (int*)malloc(sizeof(int)); ..........................free(ptr); // ptr is a dangling pointer now and operations like following are invalid *ptr = 10; // or printf("%d", *ptr); int* ptr = NULL { int x = 10; ptr = &x; } // x goes out of scope and memory allocated to x is free now. //…

    Continue Reading
  • Interview Quetions

    What is the description for syntax errors?

    December 15, 2019 - By tejsumeru.12@gmail.com

    The mistakes when creating a program called syntax errors. Misspelled commands or incorrect case commands, an incorrect number of parameters when called a method /function, data type mismatches can identify as common examples for syntax errors.

    Continue Reading
  • Interview Quetions

    What is keyword auto for?

    December 15, 2019 - By tejsumeru.12@gmail.com

    By default every local variable of the function is automatic (auto). In the below function both the variables ‘i’ and ‘j’ are automatic variables. void f() { int i; auto int j; } NOTE − A global variable can’t be an automatic variable.

    Continue Reading
  • Interview Quetions

    What are the basic data types associated with C?

    December 15, 2019 - By tejsumeru.12@gmail.com

    Int – Represent the number (integer) Float – Number with a fraction part. Double – Double-precision floating-point value Char – Single character Void – Special purpose type without any value.

    Continue Reading
  • Interview Quetions

    Distinguish between malloc() and calloc ()memory allocation.

    December 15, 2019 - By tejsumeru.12@gmail.com

    Both allocates memory from heap area/dynamic memory. By default calloc fills the allocated memory with 0’s

    Continue Reading
  • Interview Quetions

    What is a pointer on pointer?

    December 15, 2019 - By tejsumeru.12@gmail.com

    It’s a pointer variable which can hold the address of another pointer variable. It de-refers twice to point to the data held by the designated pointer variable. Eg: int x = 5, *p=&x, **q=&p; Therefore ‘x’ can be accessed by **q.

    Continue Reading
  • Interview Quetions

    What are the key features in the C programming language?

    December 15, 2019 - By tejsumeru.12@gmail.com

    Portability – Platform independent language. Modularity – Possibility to break down large programs into small modules. Flexibility – The possibility to a programmer to control the language. Speed – C comes with support for system programming and hence it is compiling and executes with high speed when compared with other high-level languages. Extensibility – Possibility to add new features by the programmer.

    Continue Reading
  • Interview Quetions

    What is NULL pointer?

    December 15, 2019 - By tejsumeru.12@gmail.com

    NULL is used to indicate that the pointer doesn’t point to a valid location. Ideally, we should initialize pointers as NULL if we don’t know their value at the time of declaration. Also, we should make a pointer NULL when memory pointed by it is deallocated in the middle of a program.

    Continue Reading
  • Interview Quetions

    When should we use pointers in a C program?

    December 15, 2019 - By tejsumeru.12@gmail.com

    1. To get address of a variable 2. For achieving pass by reference in C: Pointers allow different functions to share and modify their local variables. 3. To pass large structures so that complete copy of the structure can be avoided. 4. To implement “linked” data structures like linked lists and binary trees.

    Continue Reading
 Older Posts
Newer Posts 

Categories

  • AI
  • Android With Java
  • Android With Kotlin
  • C language
  • C++ Language
  • Computer Vision
  • Data Structure
  • Design
  • Error Solving
  • Flutter
  • Go Lang
  • Interview Quetions
  • Java
  • Javascript
  • Kotlin
  • Machine Learning
  • MATLAB
  • PHP
  • Python
  • SciPy
  • Technology
  • Tutorials
  • Uncategorized
  • Wordpress
Graceful Theme by Optima Themes