Wednesday, October 17, 2018

Rangkuman 17/10

Pointer
1. Syntax:
<type> *ptr_name;
2. Example:
int i,*ptr;
ptr = 41;

Pointer to Pointer
1. Syntax
type **ptr_ptr
2. Example
int i ,*ptr, **ptr_ptr;
ptr-&i;
ptr_ptr = &ptr

Array
1.Syntax:
typearray_value[valuedim];
2 Example:
Int A[10]

Example of Array Initialization
Int B[5]={1,2,-4,8};

Example Pointer Constant and Pointer variable
Int x=10, y=20;
int *ptr;
ptr = &x;
ptr = &y;

Accesing Array
int array[10];
int *ptr_arr;
ptr_arr = arr;;

3 type of array
1. One dimensional array
2. Two dimensional array
3. Three dimensional array

string manipulation
1. strlen()
2. strcpy(s1,s2)
3. strncpy(s1.s2)
4. strcat(s1,s2)
5. strcmp9s1,s2)
etc

No comments:

Post a Comment