Search:

Type: Posts; User: bbebfe

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    14
    Views
    4,551

    I have just written an utility routine for...

    I have just written an utility routine for traversing path recently. I think it may be useful to you.

    I have compiled and run it on Linux and Windows both, but if you want to use it on Windows, ...
  2. Replies
    14
    Views
    4,551

    sorry, duplicated post!

    sorry, duplicated post!
  3. Replies
    14
    Views
    4,551

    For string comparison, try strstr or strspn.

    For string comparison, try strstr or strspn.
  4. Replies
    12
    Views
    3,702

    Haha, just a little.

    Haha, just a little.
  5. Replies
    12
    Views
    3,702

    Referring to Lex & Yacc, or Flex & Bison. They...

    Referring to Lex & Yacc, or Flex & Bison. They are both parser and analyzer generation tools.
  6. Replies
    8
    Views
    6,563

    matsp is right, How max and min of a type, there...

    matsp is right, How max and min of a type, there is no definite value within C, It's depends on the C compiler and target system. You can get the max and min value of char by referring the CHAR_MAX...
  7. Replies
    8
    Views
    6,563

    The value of char in C is (-128 -> 127), or...

    The value of char in C is (-128 -> 127), or using unsigned char instead of char if you want 150.
  8. Replies
    9
    Views
    1,728

    Unlike Java automatic garbage collection...

    Unlike Java automatic garbage collection mechanism, you need to free the memory allocated by malloc manually in C.

    char *p = (char*)malloc(100);
    strcpy(p, "hello");
    free(p); //free the memory
  9. Replies
    20
    Views
    5,100

    You are actually right, it's more better now.

    You are actually right, it's more better now.
  10. Replies
    33
    Views
    9,589

    You have two while loops and of which are both...

    You have two while loops and of which are both get character from [I]stdin. the outer loop eats the first character the user inputted each time.

    You put the return statement within the outer loop,...
  11. Replies
    20
    Views
    5,100

    You are right, getchar returns an unsigned char,...

    You are right, getchar returns an unsigned char, and converts it to int.

    so the modified code is


    int scan;
    while ((scan = getchar()) != EOF)


    but getchar is equivalent to getc with...
  12. Replies
    20
    Views
    5,100

    When you want to print the result out, just...

    When you want to print the result out, just traversing the array and printing it like this:


    printf("%c - %d\n", index+65 /* upper case out */, a[index]);
  13. Replies
    20
    Views
    5,100

    tabstop means that using the ascii value of the...

    tabstop means that using the ascii value of the character as the index of the array.

    It seems that your program is case-insensitive, so try the function below to obtain the corresponding index of...
  14. Replies
    34
    Views
    6,747

    Hey, skelesp. Maybe core dump is a choice. Your...

    Hey, skelesp.
    Maybe core dump is a choice. Your program stops without any sign, so I think it's crashed nor stopped. If you are using linux system, you can try these steps below:
    1. $ ulimit -c ...
  15. Replies
    2
    Views
    6,004

    Thank you so much! I get it.

    Thank you so much! I get it.
  16. Replies
    2
    Views
    6,004

    What does seven time or seven-time mean?

    Hey guys!

    You see, I love this community, and I'm not just learning programming, but English as well.

    I'm concentrating on NBA now, but I can't understand what "seven time" means? I can't find...
  17. Replies
    5
    Views
    6,673

    Your answer is better, strtok is a better choice....

    Your answer is better, strtok is a better choice. I'm also studying C programming from you all guys in this forum. thx.



    i=strlen(string)-1)

    I want to test if the last character of the...
  18. Replies
    5
    Views
    6,673

    I have not run your code, but I think you will...

    I have not run your code, but I think you will never meet the last word in the string as the function gets discards the new line character.
    use
    if(string[i]==' ' || i=strlen(string)-1) instead
    ...
  19. Replies
    5
    Views
    2,268

    vim+tags may be a choice.

    vim+tags may be a choice.
  20. Replies
    15
    Views
    8,745

    There are two problems within your code. 1. You...

    There are two problems within your code.
    1. You should pass a pointer rather than the variable itself to scanf


    scanf("%f", &monnaie);


    2. Adding #include <stdlib.h> in your code in which...
  21. Replies
    4
    Views
    1,450

    As tabstop said, "else if( fgetc(sp)==EOF)" has...

    As tabstop said, "else if( fgetc(sp)==EOF)" has moved the file position of file stream sp, you should use fseek(sp, 0, SEEK_SET) to move it back. Or using feof(sp) to test if EOF encountered to avoid...
  22. Replies
    13
    Views
    1,471

    You have not set any value to root->name before...

    You have not set any value to root->name before using it within strcmp in your library function tree_insert, which is invoked in main.c after create_tree, It results an access violation error.
    ...
  23. How to judge whether a path is relative or absolute?

    As the title, is there a function in GNU C library?
  24. Replies
    7
    Views
    1,963

    Ah, you have three problems in your code still....

    Ah, you have three problems in your code still.
    1. I have no idea about if there is a convenient way to use array with sscanf, the ugly way here is :


    sscanf(text, "&#37;lf %lf %lf %lf %lf", v, v+1,...
  25. Replies
    7
    Views
    1,963

    You have at least 4 problems in your code. 1....

    You have at least 4 problems in your code.
    1. Never use literal value as the size of array, using sizeof instead.


    while(fgets(text, sizeof(text), Inf_1)!=NULL)


    2. text is an array of...
Results 1 to 25 of 27
Page 1 of 2 1 2