I\'m trying to simulate the behavior of a DNS server, which I have a DB named hosts.txt containing machine_names/IP_addresses, for example:
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code nece
This question already has answers here: Closed 12 years ago. Possible Duplicate: strtok wont accept: char *str
I have been spending some time in debugging a p开发者_开发知识库rogramme which gives segmentation fault. The bug is quite indeterministic and intermittent, which is annoying. I narrowed it down to the
I am reading a line from a file containing the names of people, first line contains names of males, and seconds line contains names of females. Then I want to store these names in two arrays, one for
In the below program , I intend to read each line in a file into a string , break down the string and display the individual words.The problem I am facing is , the program now outputs only the first l
I\'m trying to make a program with structs and files. The following is just a part of my code(it;s not the entire program).
OK. For example I have this line in my txt file: 1|1,12;7,19;6,4;8,19;2,2 As you can see, it has 2 parts, separated by |. I have no problems getting both parts, and separating second part 1,12;7,19;6
Hi I\'m trying to tokenize a string by loading an entire file into a char[] using fread. For some strange reason it is not always working, and valgrind complains in this very small sample program.
I have a function using strtok like this void f1(char *name) { ... char *tmp; tmp = strtok(names, \" ,\");