Search:

Type: Posts; User: Super-Man

Search: Search took 0.00 seconds.

  1. do fread and fwrite have failure? how to handle this?

    when I read from a file using fread (C language), the return value of fread sometimes would be 0.
    As manual suggested:

    do I have to write code like this?

    int bytes_read;
    while((bytes_read...
  2. Replies
    2
    Views
    1,472

    Not getting a NULL pointer error in C

    I was purposely trying to get a NULL pointer in C but I failed to do this. Here is what I was coding:


    int main(void) {
    int x; //UNINITIALIZED so that it will represent "nothing"
    int...
  3. Replies
    2
    Views
    2,913

    Problem with an array of pointers

    #include <stdio.h>

    int main()
    {
    char *p[] = {"One","Two","Three"};
    int i=0;
    while(p[i] != NULL)
    printf("%s\n", p[i++]);

    return 0;
  4. Replies
    5
    Views
    2,621

    I did not ask to ask me questions, I took this...

    I did not ask to ask me questions, I took this example from the textbook. I read a bad textbook and therefore I need answers and not questions. All problem solved
  5. Replies
    5
    Views
    2,621

    Function month_day: Segmentation fault

    In theory, the function should work:

    #include <stdio.h>

    static char daytab[2][13] = { {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
    {0, 31, 29, 31, 30,...
  6. Replies
    1
    Views
    1,632

    >: Address already in use

    #include <stdio.h>
    #include <sys/socket.h>
    #include <sys/types.h>
    #include <errno.h>
    #include <sys/un.h>
    #include <stdlib.h>
    #include <string.h>

    int main()
    {
Results 1 to 6 of 8