All 1 entries tagged Computer

View all 31 entries tagged Computer on Warwick Blogs | View entries tagged Computer at Technorati | There are no images tagged Computer on this blog

October 16, 2007

passing variables to subroutines in C

I always forget how to do it!

//declare variable globally
int TINF;

//in the subroutine use a * for a pointer, and then continue throughout
void epi_stats(int *TINF) {
*TINF = something;
}

//in the main program call the subroutine and assign the value using &
int main(int argc, char** argv) {
epi_stats(&TINF);
}


October 2020

Mo Tu We Th Fr Sa Su
Sep |  Today  |
         1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Search this blog

Things_I_have_learnt_today

Most recent comments

  • que bonito color rosa tenes vos en tu site =) by carlos on this entry

Blog archive

Loading…
Not signed in
Sign in

Powered by BlogBuilder
© MMXX