Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "tp09.h"
- int main_tp09(int argc, const char *argv[])
- {
- PT p1={1,1},p2={2,1},p3;
- p3=p1; // só a atribuiçao é permitada em structs (nem comparação ou aritemetica funcionamm)
- if(p3.x==p1.x && p3.y==p1.y) // ver se são dois pontos iguais
- {
- printf("Sao iguais!");
- }
- printf("p3= %d,%d",p3.x,p3.y);
- scanf("%d%d",&p3.x,&p3.y);
- }
- int compare_points(PT p1,PT p2)
- {
- return (p1.x==p2.x) && (p2.y == p1.y);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement