Showing posts with label coaching for c in Bopal-Ahmedabad. Show all posts
Showing posts with label coaching for c in Bopal-Ahmedabad. Show all posts

Monday, December 31, 2018

What is use of pointer in C? tccicomputercoaching.com

What is pointer?

Pointer is a variable used to store address of another variable in programming language .

What is the use of Pointer?

The importance of pointers comes with the use of functions. For an example think you code a function to add two values and assign it to the first value. I'll show you how to do it with and without pointers.



Without pointer
int adder(int a, int b){
return a+b;
}
void main()
{
int c = 5;
int d = 6;
c = adder(a,b);
}

So here no use of pointers and this method of using functions is called as call by value. Here value of c 5 and value of d 6 is passed to function adder as a and b and return the value.

So, you should use pointers any place where you need to obtain and pass around the address to a specific spot in memory.

Coding a data structure such as linked list. Without the use of pointers, this becomes an impossible task with C.

Pointer is used to allocate dynamic memory.

Pointers allow you to refer to the same space in memory from multiple locations. This means that you can update memory in one location and the change can be seen from another location in your program.

To learn more about pointer or any concepts of C Programming Language

Visit us @ http://tccicomputercoaching.com/

Call us @ 9825618292

Tuesday, November 27, 2018

What is the use of Structure in C? tccicomputercoaching.com

Structures have very efficient role in c. As you can see the Array- it is used for same type of data. It contains you can have different type of data to define a real-time entity like books, student, etc.



Structure is a data type which allows to store different type data at same location at same time.

The most efficiently data structures are used in c is stack, queue, tree, linked list, doubly linked list, hash table etc.

Use of Structure:


  • Suppose you are having record of 100 students. Each student is having name(which is of char[] type), id(int type) and marks(float type). All these three properties is uniquely owned by each student. Each student will carry this three different data type information.
  • Now, suppose you have to pass complete information of all students to one function for some reason. At that point rather than passing each and every information (name, id, marks, etc...) one by one for every student will not be a good way of programming. In such case we will prefer approach in which can pass complete student information as an single entity of one by one student.
  • Hash table, it is used for making table for particular entity. For example an attendance register of a classroom. ( Inside system, kernel maintains process table, file table, inode table, etc etc.)
  • So, where ever we need to refer different data types information as an single entity then we go for structure and above is the real time example where we would like to go for structure.
  • TCCI can teach you all programming Language at your flexible time.


To learn Structure in C at TCCI .

Call us @ 98256 18292

Visit us @ http://tccicomputercoaching.com/course/