This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
struct point | |
{ | |
int x; | |
int y; | |
}; | |
struct notpoint | |
{ | |
int x; | |
int y; | |
}; | |
int main() | |
{ | |
struct point p1={10,20}; | |
struct point p2={-10,-20}; | |
p1=p2; | |
printf("%d\t%d",p1.x,p1.y); | |
struct notpoint p3={100,200}; | |
p3=p1; | |
printf("%d\t%d",p3.x,p3.y); | |
if(p3>p2) | |
{ | |
printf("hello\n"); | |
} | |
else | |
{ | |
printf("C programming\n"); | |
} | |
return 0; | |
} |
compilation error in line 19 , as you can not assign two structures of different types
also there is a compilation error in line 21 as rational operators can not be applied on structures
No comments:
Post a Comment