Search
 
SCRIPT & CODE EXAMPLE
 

C

c structure with pointer

#include<stdio.h>
 
struct Point
{
   int x, y;
};
 
int main()
{
   struct Point p1 = {1, 2};
 
   // p2 is a pointer to structure p1
   struct Point *p2 = &p1;
 
   // Accessing structure members using structure pointer
   printf("%d %d", p2->x, p2->y);
   return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: sleep in c programming 
C :: how to remove button decoration 
C :: What are the 3 basic types of Plate Boundaries? Explain their differences (how they act). 
C :: terminal count files in directory 
C :: get pid c 
C :: printf format specifiers 
C :: how to print something out to the console c 
C :: find maximum number between 3 numbers in c 
C :: how to map one value to another in C 
C :: same project on different monitor in intellij mac 
C :: vowel or consonant in c 
C :: how to get user input in c 
C :: windeployqt example 
C :: successeur nombre chaine 
C :: write a program in c to check whether the number is armstrong or not 
C :: block a website on mac 
C :: c fractional sleep 
C :: find length of int number in c 
C :: pg_restore: error: input file appears to be a text format dump. Please use psql. 
C :: for loop in c 
C :: Access denied creating xampp-control.ini 
C :: input array elements in c 
C :: what is the usage of extern in c 
C :: prime factorization of factorials using c 
C :: mount cifs 
C :: typedef c struct 
C :: print to console in c 
C :: function component with props 
C :: how to change file permissions in C language 
C :: fread 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =