Search Results

Search found 2 results on 1 pages for 'baskin'.

Page 1/1 | 1 

  • strtok program crashing.

    - by baskin
    Hi, the program for strtok given on http://www.opengroup.org/onlinepubs/000095399/functions/strtok.html crashes everytime.. #include <string.h> ... char *token; char *line = "LINE TO BE SEPARATED"; char *search = " "; /* Token will point to "LINE". */ token = strtok(line, search); /* Token will point to "TO". */ token = strtok(NULL, search); If I use a char array for variable 'line', it works. i.e. char line[] = "LINE TO BE SEPARATED" works. Kindly explain.

    Read the article

  • strict string to int[long]

    - by baskin
    Do we have a standard way of converting a char* to int (or long) in a strict way, i.e. we should get proper result only if all characters are digits and can fit in an int (or long) -- some way by using strtol etc.. ? Thus "sbc45", "4590k", " 56", "56 ", should be all invalid using that function.

    Read the article

1