Search:

Type: Posts; User: qingxing2005

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Hey Elysia, I figure it out, thanks for the...

    Hey Elysia,

    I figure it out, thanks for the hints. I used fscanf_s plus fseek.

    Bests,

    Qing
  2. Hey tabstop, Thanks for the hints, points...

    Hey tabstop,

    Thanks for the hints, points well taken. :0)

    Bests,

    Qing
  3. Check strings which should only contain some characters.

    Dear all,

    In my case, there are some strings like "NAME_ID", "EMPLOYEE_ID" etc, which should only contain some characters from A to Z (both upper case and small letter) and "_". Currently, there...
  4. Hey Elysia, In my application, since I have to...

    Hey Elysia,

    In my application, since I have to extract the words "THERE","IS","A","DOG" respectively from the sentence "THERE_IS_A_DOG" according to "_", so is there a way of using "fscanf_s" to...
  5. Hey tabstop, I reformulated it a little bit....

    Hey tabstop,

    I reformulated it a little bit. So my question is that if it is possible to read the line "THERE_IS_A_DOG" again after reading it by using fscanf_s?
  6. How can I make a program to read the first line "There_is_a_dog" twice?

    Dear all,

    In my application, there are some sentences (each per line) to be read from the txt file, e.g.

    There_is_a_dog
    There_are_two_men
    ...

    I used fscanf_s to read them each per line...
  7. Hey Elysia, Thanks for it. I fix the...

    Hey Elysia,

    Thanks for it.

    I fix the problem, i.e. by using LONG_MAX and LONG_MIN.

    Best,

    Qing
  8. Hey Elysia, I used your proposed statement in...

    Hey Elysia,

    I used your proposed statement in the following way, i.e.


    if (strtol(_temp, NULL, 10))
    {
    number = strtol(_temp, NULL, 10);
    }
  9. Hey gltiich, I am using "atoi" or "atol" to...

    Hey gltiich,

    I am using "atoi" or "atol" to convert string "9512311349" to integer, while none of them raised any error (actually both of them returned value "1".) and the converted value is...
  10. Hey Elysia, I found out this statement works...

    Hey Elysia,

    I found out this statement works well, i.e. fscanf_s(fp_t, "%s\n", _temp, (size_t) 100), where _temp is a string array.
  11. Hey guys, At first, thanks for all your...

    Hey guys,

    At first, thanks for all your replies.

    Secondly, I plan to adopt the way of reading the line in terms of string at first, then convert it to long int meanwhile with the checking. The...
  12. A question about using "fscanf_s" to read data in the txt file.

    Dear all,

    In my app, my program has to read a set of data (each per line) in the txt file. I used the following statement in order to do this, i.e. while (fscanf_s(fp_t, "%ld\n", &number)), where...
  13. Hey Elysia, Thanks for the reminding. ...

    Hey Elysia,

    Thanks for the reminding.

    Bests,

    Qing
  14. Hey 39ster, It works in my application. Thanks...

    Hey 39ster,

    It works in my application. Thanks for it!

    Best,

    Qing
  15. Hey Salem, I tried to open the txt file in...

    Hey Salem,

    I tried to open the txt file in "rb" mode (read in binary mode), while there are still two squares followed by the main part of the string. I.e. even one more square followed by. :0(
    ...
  16. Hey carrotcake1029, I checked it by hex...

    Hey carrotcake1029,

    I checked it by hex editor, there are "0D0A" after "NAME_ID", by which means carriage return and new line. I think they are fine.
  17. Hey 39ster, Actually, the "_Square" I used in...

    Hey 39ster,

    Actually, the "_Square" I used in the description is not a real string, just a symbol which is shown like a "square" following the main part of the string pointer _Name. E.g. if the...
  18. Hey tabstop, I knew it, while how can I do it?...

    Hey tabstop,

    I knew it, while how can I do it?

    I allocated the memory before using the string pointer, i.e. _Name = (char*) malloc( sizeof(char) ) since the content in the txt file is not...
  19. Dear all, In my app, I used fgets(_Name, 30,...

    Dear all,

    In my app, I used fgets(_Name, 30, fp_t) to read a string (for instance either "NAME_ID", "A DOG" or whatever that is not specific) from a txt file and save the value to a string pointer...
  20. Dear all, thanks for all of you guys' replies....

    Dear all,

    thanks for all of you guys' replies.

    For the URL of file, it was my mistake to specify it wrongly. In the real code, the URL is stored in a string, which should follow the right...
  21. An issue with using fscanf_s to read data like "&1&2" from a file.

    Dear all,

    I met a problem about using "fscanf_s" to read string "&1&2" from the file "A.txt". The snippet of the code is described as follows,

    char first[5];
    char second[5];
    int number1 = 0;...
  22. How to resume thread at the specific time instance?

    Dear all,

    I met one problem about resuming the thread. The thread function init() should be executed when the thread test_thread() is resumed. However, it is never done by my following snippet of...
  23. Re: Resuming thread issue.

    Dear vart,

    Thansk for your reply and suggestions. They are really helpful.

    However, I still met one further problem about resuming the thread. The thread function init() will be executed when...
  24. Question about Multiple threads and ring buffer.

    Dear all,

    My program scenario is as follows.

    Three threads (thread 1-3) will fetch values from the ring buffer. E.g. after one thread gets one value from ring buffer of which length is 100, the...
  25. Hey, in my piece of code, there ie only 10000000...

    Hey, in my piece of code, there ie only 10000000 used. I donnot so whether this number appeared. :0)
Results 1 to 25 of 26
Page 1 of 2 1 2