User Profile

Collapse

Profile Sidebar

Collapse
dasarath mood
dasarath mood
Last Activity: Jan 25 '07, 06:59 AM
Joined: Nov 29 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • dasarath mood
    replied to Segfault during a call to fopen
    in C
    you malloc() a limited buffer using strcat(), but if the string is longer than u allocated memory for fname, the buffer will not be big enough. use strncat, and calculate the remaining space for the strncat() appropriately every time .

    u will not get any problem after this.always use strncat ,it solves memory problems.
    See more | Go to post

    Leave a comment:


  • dasarath mood
    replied to Program that prints it's own source
    in C
    this is the simple code:

    char*s="char*s= %c%s%c;main(){p rintf(s,34,s,34 );}";main(){pri ntf(s,34,s,34); }...
    See more | Go to post

    Leave a comment:


  • dasarath mood
    replied to Segfault during a call to fopen
    in C
    what is fname..???
    have u allocated enough memory for fname..????
    check once memory issues......
    See more | Go to post

    Leave a comment:


  • dasarath mood
    replied to how to swap
    in C
    hey man..its not home work problem..this question was asked in one of the interview..i know how to do with shift operator ..but i don't know how to do it without shift operator.
    See more | Go to post

    Leave a comment:


  • dasarath mood
    started a topic how to swap
    in C

    how to swap

    how to swap the 2 bytes..B1 and B2(16 bits)..without using shift operator.
    See more | Go to post

  • dasarath mood
    replied to how to write code...
    in C
    no..iam asking help to solve this problem...
    See more | Go to post

    Leave a comment:


  • dasarath mood
    replied to how to solve this problem
    in C
    ok thanks for all of u..i got some points from u...
    See more | Go to post

    Leave a comment:


  • dasarath mood
    replied to how to write code...
    in C
    this code is to check the entries in the directory(eithe r current or any specified)...

    in this code what i have to do is ..i have add the check to see wheather the name which is listed from this code is available in another directory called example d.ids..if name is available in that(d.ids) directory we have to continue...othe rwise we have to skip...
    See more | Go to post

    Leave a comment:


  • dasarath mood
    started a topic how to write code...
    in C

    how to write code...

    char id_dir[PATH_MAX] = {0,};
    strncpy(id_dir, a->id_file_name , PATH_MAX);
    id_dir[PATH_MAX-1] = 0;
    strncpy(id_dir, ".d/", PATH_MAX - strnlen(id_dir, PATH_MAX));
    struct dirent *id_file = NULL;
    do {
    errno = 0;
    dp = readdir(id_dir)
    if (!dp)
    break;
    /* how add check here to ensure name ends in ".ids"(director y), skip if not. */
    f = fopen(id_file,...
    See more | Go to post

  • dasarath mood
    replied to how to solve this problem
    in C
    hi man, i want to write code in c man..not GUI or running DOS commands.....
    See more | Go to post

    Leave a comment:


  • dasarath mood
    started a topic how to solve this problem
    in C

    how to solve this problem

    In c i have to create new directory , i have to add the files to the directory and
    we have to add this new directory to another old directory..plea se suggest any solution to this problem...
    See more | Go to post
No activity results to display
Show More
Working...