Search:

Type: Posts; User: C-learning

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    3,111

    sscanf never returns eof, it returns the count of...

    sscanf never returns eof, it returns the count of
    variables it managed to scan in.
    Try


    while (sscanf (......) != 0)
    {
    .
    .
    .
  2. Replies
    10
    Views
    2,053

    Mabey a good idea to show us some code :-)

    Mabey a good idea to show us some code :-)
  3. Replies
    10
    Views
    2,053

    Mabey a good idea to show us some code :-)

    Mabey a good idea to show us some code :-)
  4. Replies
    4
    Views
    1,772

    if ((T->left == NULL) && (T->right == NULL)) ...

    if ((T->left == NULL) && (T->right == NULL))
    return 1;



    Dont you get wrong result with this code?
    You should be counting up every time you visit a leave and when
    the no leave exist, you...
  5. Replies
    3
    Views
    1,644

    int searchX(char string[], char dict[], char...

    int searchX(char string[], char dict[], char dictSpace[]){
    char *p;
    p = strtok(string, " ");
    int len = strlen(string);


    do{
    p = strtok('\0', " ");
    ...
  6. Replies
    5
    Views
    1,142

    Wasnt i actually saying this or is my english bad?

    Wasnt i actually saying this or is my english bad?
  7. Replies
    5
    Views
    1,142

    int any(char s1[], char s2[]) { int i,j; ...

    int any(char s1[], char s2[])
    {
    int i,j;

    for(i = 0; s1[i] != '\0'; i++)
    {
    for(j = 0; s2[j] != '\0' && s2[j] != s1[i]; j++)
    {
    if (s1[i] == s2[j])
    ...
  8. Thread: Blast

    by C-learning
    Replies
    14
    Views
    2,975

    Update and have you cleaned it away from the...

    Update and have you cleaned it away from the register?
  9. Replies
    12
    Views
    3,242

    But what if you get an EOF in the inner getch() ...

    But what if you get an EOF in the inner getch() ?
    Kaputt?


    EDIT: not getch(), getchar() :- )
  10. Replies
    5
    Views
    1,562

    I cant really understand what the problem is but...

    I cant really understand what the problem is but
    one thing i can see is that you call put_row with wrong arguments



    put_row(c, step, stop);



    shouldnt it be:
  11. Replies
    10
    Views
    1,351

    int point_size (char *a) { int i = 0,...

    int point_size (char *a)
    {

    int i = 0, pointer_eh;

    while (*(a+i) != '\0')
    {
    *(a+1);
    i++;
    }
  12. UL = unsigned long i think :-)

    UL = unsigned long

    i think :-)
  13. number & (1UL

    number & (1UL<<n)

    if you want to see if the 6:th bit is set in number ,then n = 6
    The result of the operation is 1 if its set and 0 if its not.
  14. Thread: palindrome

    by C-learning
    Replies
    2
    Views
    1,706

    You have declared str as int * This could be ok,...

    You have declared str as int *
    This could be ok, but then you would have to cast it to char
    before comparing with '\0'
    like

    while(((char)*(str+i))!= '\0')

    easiest would be to change int...
  15. Replies
    7
    Views
    1,659

    void cutline(void) { extern char s[]; ...

    void cutline(void)
    {
    extern char s[];
    int i;
    extern int len;

    for (i = len; i > 0; i--)
    if (s[i] == ' ')
    s[i] == '\n'; / * this must be wrong what about s[i]='\n'...
  16. Replies
    9
    Views
    9,708

    void reset_board() { int i=0, n=1; for(i=0;...

    void reset_board()
    { int i=0, n=1;
    for(i=0; i<=8; i++)
    {
    board[i]=n;
    n++;
    }
    }
  17. Thread: ? and :

    by C-learning
    Replies
    12
    Views
    1,233

    Why not use the comma operator , like this: ...

    Why not use the comma operator , like this:




    (result!=5) ? (a++,b++) : (C+=2,D-=2);



    Should work fine.
  18. Replies
    7
    Views
    1,919

    K.N.KING called C Programming: A Modern Approach...

    K.N.KING called C Programming: A Modern Approach

    Actually its a GREAT book!

    I remember doing the same program then.
  19. Replies
    4
    Views
    3,578

    Its because the '\n' character. Fgets dont read...

    Its because the '\n' character.
    Fgets dont read the line character, leaves it. So
    next time when scanf starts to read it finds the '\n' char first and stop reading.
    After fgets, test if '\n' was...
  20. Thread: looping

    by C-learning
    Replies
    14
    Views
    1,712

    Thats true. But i was never good at math... :D

    Thats true.
    But i was never good at math...

    :D
  21. Thread: looping

    by C-learning
    Replies
    14
    Views
    1,712

    while(1) is 8 letters for( ; ; ) is 7 letters......

    while(1) is 8 letters
    for( ; ; ) is 7 letters...

    :D
  22. Replies
    10
    Views
    1,690

    Please...

    Use CODE tags
  23. Replies
    6
    Views
    1,431

    hmmm

    Shouldn you try sum == num
    after the loop.
    ANd if im not that wrong you never get a perfect number because
    you start with 2.
    1 is the divisor of all numbers and you never add 1 to sum.
    And it...
  24. Replies
    6
    Views
    1,207

    Really liked this page

    Really liked this page
  25. Replies
    2
    Views
    1,027

    Ok, thanks for the help. Now i see the big...

    Ok, thanks for the help.
    Now i see the big picture.
Results 1 to 25 of 28
Page 1 of 2 1 2