Category: Uncategorized
-
Function Call: Pass by Pointer
Pass by pointer means to pass a pointer argument in the calling function to the corresponding formal parameter of the called function. The called function can modify the value of the variable to which the pointer argument points. The following example shows how arguments are passed by pointer: void swapnum (int *i, int *j) {…
-
Function Call : Pass by Reference
#include<stdio.h> #include<conio.h> void interchange( int *num 1, int num 2) { int temp; temp= *num 1; *num 1= *num 2; *num 2= temp; } int main() { int num 1= 50, num 2=70; interchange(& num 1, & num 2); printf(“\n Number 1:%d”,num 1); printf(“\n Number 2: %d”,num 2); return(0); } Output: Number 1: 70 Number…
-
Function call: Pass by Value
Here, is the program of function call pass by value- #include<stdio.h> #include<conio.h> void interchange(int number 1, int number 2) { int temp; temp=number 1; number 1= number 2; number 2= temp; } int main() { int num 1=50, num 2=70; interchange(num 1, num 2); printf(“\n Number 1: %d”,num 1); printf(“\n Number 2 : %d”,num 2);…
-
Function call : Pass by Value
#include<stdio.h> #include<conio.h> void main() { int x[5],i; void display(int [],int); clrscr(); printf(“\n Array Data \n”); for(i=0;i<5;i++) scanf(“%d”,&x[i]); display(x,5); return; } void display(int a[],int n) { int i=0; printf(“\n Array Data \n”); while(i<n) { printf(“%5d”,a[i]); i++; } return; }
-
POINTERS
Pointers are variables that hold the address of another variable of same data type. Whenever a variable is declared , system will allocate a location to that variable in the memory to hold value.This location will have its own address number. A pointer variable therefore nothing but a variable that contains an address of another…
-
Dynamic Memory Allocations in C
It is a process of allocating or deallocating the memory at run time. It is called as dynamic memory allocation. when we are working with array or string static memory allocation will be take place that is compile time memory management. when we are allocating the memory of compile we cannot extend the memory at…
-
Form of C function
.1. Function declaration : General syntax of function declaration is : return -type function name – name ( parameter – list); Every function must be declared before its called. A function declaration tells the compiler about a function name and how to call the function. The actual body of the function can be defined separately.…
-
STORAGE CLASS
Every variable in c programming has two properties: type and storage class. Type refers to the data type of variable whether it is character or integer or floating point value etc. . Storage class determines how long it stays in existence. There are four types of storage class : automatic external register static auto :…
-
Data types in C
Type Range Bytes required char -128 to 127 1 unsigned char 0 to 255 1 int -32768 to 32767 2 unsigned int 0 to 65535 2 unsigned long int 0 to 4294967295 4
-
My First Blog Post
Be yourself; Everyone else is already taken. — Oscar Wilde. This is the first post on my new blog. I’m just getting this new blog going, so stay tuned for more. Subscribe below to get notified when I post new updates.