Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
struct
//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; } struct key { char* word; int count; } keytab[]; 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
In Class 1.23.17 Bit operations
A_141124_arrayMaxMin02
sample
C_141203_CadenasVarias
child process
MinMaxArray
My first structure
14th Dec Project1 v0.2
Simple Fork
150108_recursividadFactorial