Search:

Type: Posts; User: gooey_kablooie

Search: Search took 0.00 seconds.

  1. Replies
    15
    Views
    3,473

    if u write max = ~min, max will be stored with...

    if u write max = ~min, max will be stored with the 1's complement of min....

    As min is 0 max (in binary) will be 11111........1 31 times...

    Hence max gives the max value an unsigned int can...
  2. Replies
    15
    Views
    23,287

    About the feof call reading the last line twice,...

    About the feof call reading the last line twice, its not the reading the last line for the second time.
    If you want to test for feof then it should be scanned first. For your code its scanning it...
  3. Replies
    3
    Views
    8,687

    your temp pointer is pointing to some memory not...

    your temp pointer is pointing to some memory not allocated. if u read the man page for strncpy, it says that your destination should be a buffer i.e. u cant pass a pointer that has no memory...
  4. Replies
    15
    Views
    23,287

    It will throw a problem in the main function as...

    It will throw a problem in the main function as well.

    Just follow these steps :

    1 . gcc -g "your_c_file"

    2. gdb a.out

    3. b main
  5. Replies
    15
    Views
    23,287

    simplest way is to add " name = malloc ( SIZE )...

    simplest way is to add " name = malloc ( SIZE ) " in ur code...

    SIZE depends on your requirement of the number of characters in a name...

    Or as you said "point it to a char array".....That...
  6. Replies
    15
    Views
    23,287

    Hi yougene... About your segmentation fault : ...

    Hi yougene...

    About your segmentation fault :

    You haven't allocated memory for char *name. Allocate memory for it and your seg problem is solved.
    It worked fine for me.
Results 1 to 6 of 6