Knowledge Walls
Venkatesan
Hyderabad, Andhra Pradesh, India
Passcode:
Introduction [cont'd]
Input Output Functions [cont'd]
Structures and Unions [cont'd]
# Preprocessor [cont'd]
Pointers and Structures in Pointers of Programming in C
2094 Views
Pointers and Structures 
Structure object can be created as pointer variable. It is used to allocate the memory for the structure object dynamically.
Program
	#include
	struct employee{
	   int employee_id;
	   char employee_name[30];
	};
	void main(){
	   struct employee *emp;
	   emp->employee_id = 1001;
	   strcpy(emp->employee_name,"Kumar");
	   printf("%d : %s",emp->employee_id,emp->employee_name);
	}
Output 
1001 : Kumar
Next Topics
Next lessons of current book.
Best Lessons of "Programming in C"
Top lessons which are viewed more times.
Structures and Unions of Programming in C
Input Output Functions of Programming in C
Structures and Unions of Programming in C
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details