Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.20 seconds.

  1. Replies
    2
    Views
    63

    It's a bit up and down at the moment :( In the...

    It's a bit up and down at the moment :(
    In the space of 30 minutes it's gone from snappy to molasses to snappy again.
  2. It's a very simple last in first out allocator....

    It's a very simple last in first out allocator.
    The last one you allocate must be the first one you free.



    #include <stdio.h>

    /* Allocation functions. */
    #define ALLOCSIZE 10000 ...
  3. Replies
    5
    Views
    100

    > what result it (1

    > what result it (1 << 4) gives ?
    You've got an editor and compiler in front of you, try it.



    for (i = 0; i < 4; i++)
    {
    nibble |= 1<<i;
    }
  4. Replies
    2
    Views
    63

    Yes, very slow for me too. I've PM'ed...

    Yes, very slow for me too.

    I've PM'ed webmaster.
  5. Replies
    49
    Views
    913

    Right, so int guess[6]; for ( i = 0 ; i < 6...

    Right, so


    int guess[6];
    for ( i = 0 ; i < 6 ; i++ ) {
    printf("Enter a number ");
    scanf("%d",&guess[i]);
    }
  6. Replies
    2
    Views
    104

    There are many bad use of printf/scanf calls, and...

    There are many bad use of printf/scanf calls, and many unused or uninitialised variables.



    $ gcc -Wall -Wextra -O2 foo.c
    foo.c: In function ‘main’:
    foo.c:30:17: warning: format ‘%d’ expects...
  7. OK, so you understand pictorially what you need...

    OK, so you understand pictorially what you need to do.

    How about some code to go with it?
  8. Replies
    49
    Views
    913

    Did it cross your mind that when you saw the...

    Did it cross your mind that when you saw the output of


    for(i=0;i<49;i++){
    printf("%d,",lotto[i]);
    }

    That changing it to
  9. You've already been shown how to add to the head...

    You've already been shown how to add to the head and tail of a list.
    You therefore ought to be able to at least make an ATTEMPT for yourself now.
  10. > Address M; > Address* fin = &M; ... >...

    > Address M;
    > Address* fin = &M;
    ...
    > fin[count] = address[i];
    > count++;
    Treating a thing which isn't an array as if it were an array is a bad idea.
  11. > Address* address[MAX_ROW] Remove all the *'s...

    > Address* address[MAX_ROW]
    Remove all the *'s from all the lines looking like this.

    So


    void input(FILE*, Address address[MAX_ROW]);
    void output(FILE* ip, FILE* op, Address...
  12. Replies
    2
    Views
    106

    Note that you only get EINTR if the timeout...

    Note that you only get EINTR if the timeout happens before any data is written at all.

    If write() manages to write just one character, you need to check the return result to determine how much...
  13. Replies
    11
    Views
    219

    What about reverse = reverse * 10 + reminder

    What about
    reverse = reverse * 10 + reminder
  14. Thread: File Data Saving

    by Salem
    Replies
    5
    Views
    155

    > Like how to check if the data is saved to a...

    > Like how to check if the data is saved to a file when the program is finished running?
    Well you could check the return result of every single fprintf call.

    On some level, you have to assume...
  15. Replies
    11
    Views
    219

    > reminder =7 > reminder =8 > reminder =9 ...

    > reminder =7
    > reminder =8
    > reminder =9
    Good, now can you put them all into reverse ?
  16. Replies
    11
    Views
    219

    Try it with only one % and one / inside the loop....

    Try it with only one % and one / inside the loop.

    Maybe just this to begin with.


    while ( number > 0 ) {
    printf("Number=%d\n", number);
    number = number / 10;
    }
  17. Thread: File Data Saving

    by Salem
    Replies
    5
    Views
    155

    > if (theta[10000]=omega*time[10000]) 1. These...

    > if (theta[10000]=omega*time[10000])
    1. These array elements don't exist.
    The last subscript in an array of 10000 elements is 9999 (it's always N-1 for an array[N])

    Line38 onwards made no...
  18. Replies
    11
    Views
    219

    Do you know about while loops? Now would be a...

    Do you know about while loops?

    Now would be a good time to find out.

    As in, while you have some number > 0, you do your % and / thing.
  19. Well you pretty much have to throw it away and...

    Well you pretty much have to throw it away and read MSDN on how to use the serial port using the Win32 API.

    You can save all the code which deals with data once it's in memory.

    But all that...
  20. Replies
    6
    Views
    148

    > but I am surprised that you did not use the...

    > but I am surprised that you did not use the else if statement
    That would imply that you have more than true/false at some level.



    if ( n == 1 ) {
    } else if ( n == 2 ) {
    } else {
    }
  21. Replies
    8
    Views
    419

    Moved to the jobs board.

    Moved to the jobs board.
  22. Replies
    6
    Views
    148

    Like so - for you to finish off... if ( E1 )...

    Like so - for you to finish off...


    if ( E1 ) {
    if ( E2 ) {
    S2;
    } else {
    S21;
    }
    } else {
  23. Replies
    6
    Views
    148

    Maybe if you gave each expression in your diagram...

    Maybe if you gave each expression in your diagram a different name, it would help when you saw the code.
  24. sync(2): commit buffer cache to disk - Linux man...

    sync(2): commit buffer cache to disk - Linux man page - code
    sync(1): flush file system buffers - Linux man page - command line

    That the bogus files disappear on reboot could just be down to an...
  25. Replies
    4
    Views
    147

    > But does any function also have life time and...

    > But does any function also have life time and scope ?
    Their scope depends on whether you use the word 'static' or not.
    Their lifetime is the life of the program - excluding the case of functions...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4