Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
structt
//Title of this code //gcc 4.8.2 #include <stdio.h> struct point{int x; int y;}; struct point makepoint(int x,int y) { struct point t; t.x=x; t.y=y; //printf("%d",t.x); return t; } struct rect { struct point pt1; struct point pt2; }; struct rect screen; int ptinrect(struct point p, struct rect r) { return p.x >= r.pt1.x && p.x < r.pt2.x && p.y >= r.pt1.y && p.y < r.pt2.y; } int main(void) { struct point t;t=makepoint(2,3); screen.pt1=makepoint(1,2); screen.pt2=makepoint(3,4); struct point middle=makepoint ((screen.pt1.x+screen.pt1.y)/2 ,(screen.pt2.x+screen.pt2.y)/2); // printf("%d,%d\n",middle.x,middle.y); //ptinrect(t, screen); printf("%d\n", ptinrect(t, screen)); struct point *pp; pp=&t; (*pp).x=1; return 0; }
run
|
edit
|
history
|
help
0
PRACTICE FINAL 2
Project 3 part 2 Book v1
ptr_to_ptr
Project 3 Part 1 v2.1
ordenarcifrademenosamas
cstructVector
Avance Pregunta 2 guía 4
B_141128_MatrizUnSoloIndice
base
Swap.c