All 1 entries tagged Things

View all 2 entries tagged Things on Warwick Blogs | View entries tagged Things at Technorati | There are no images tagged Things 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);
}


September 2020

Mo Tu We Th Fr Sa Su
Aug |  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            

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