Search Results

Search found 3 results on 1 pages for 'dorons'.

Page 1/1 | 1 

  • how to flush the console buffer?

    - by DoronS
    Hi all, i have some code that run repetedly : printf("do you want to continue? Y/N: \n"); keepplaying = getchar(); in the next my code is running it doesnt wait for input. i found out that getchar in the seconed time use '\n' as the charcter. im gussing this is due to some buffer the sdio has, so it save the last input which was "Y\n" or "N\n". my Q is, how do i flush the buffer before using the getchar, which will make getchar wait for my answer?

    Read the article

  • how to init and malloc array to pointer on C

    - by DoronS
    Hi all, looks like a memory leak when i try to initializing an array of pointers, this my code: void initLabelTable(){ register int i; hashNode** hp; labelHashTable = (hashNode**) malloc(HASHSIZE*sizeof(hashNode*)); hp = labelHashTable; for(i=0; i<HASHSIZE; i++) { *(hp+i) = NULL; } } any idea?

    Read the article

1