Search:

Type: Posts; User: sfff

Search: Search took 0.00 seconds.

  1. Replies
    5
    Views
    7,424

    that is what i am trying to do, however, the...

    that is what i am trying to do, however, the while loop only consider the first two conditions eg.

    while (guess [0] == guess [1] ||guess [0] ==guess [2]), and it simply ignore those conditions...
  2. Replies
    5
    Views
    7,424

    sorry maybe i haven't make myself clear, the...

    sorry maybe i haven't make myself clear,

    the while loop function I wrote is suppose to execute when the element in array guess[4] are equal to each other
    is that a more simple way to write this...
  3. Replies
    5
    Views
    7,424

    Multiple conditions for while

    Hi,
    i will like to assign multiple conditions for while loop with ||.
    however it seems that only the first 2 conditions will be consider and other will be ignore.

    So my question is how can i...
  4. Replies
    6
    Views
    1,059

    sorry but where should i put the getchar()... i...

    sorry but where should i put the getchar()...
    i am really new to C programming
  5. Replies
    6
    Views
    1,059

    how could i "to clear the input buffer after...

    how could i "to clear the input buffer after reading your data" in this case where input always enter end the 'enter' key

    i searched in the forum but cant really understand the concept~
  6. Replies
    117
    Views
    95,259

    hi lyuyangke , this is Fai from Hong Kong, nice...

    hi lyuyangke , this is Fai from Hong Kong, nice to meet you.
  7. Replies
    6
    Views
    1,059

    Getting out of loop

    it is solved
  8. Replies
    2
    Views
    1,005

    question about while loop

    Hi I am new to C program and have the following question,
    where is there is different between:

    while((ch=getchar())!= '\n')

    i=1;

    printf("%d \n", ch);

    and
  9. Thread: bitwise rotation

    by sfff
    Replies
    9
    Views
    1,795

    because I dont know what character will be used...

    because I dont know what character will be used each time, the aaaa is just for example andit could be any letter number or signs.
  10. Thread: bitwise rotation

    by sfff
    Replies
    9
    Views
    1,795

    sorry for the confusion, what I mean is that...

    sorry for the confusion,
    what I mean is that when I input character like "aaaaa", the program should output "-80 88 44 22" , which is bitwise rotation to the right 1 bit at a time.

    yet my coding...
  11. Thread: bitwise rotation

    by sfff
    Replies
    9
    Views
    1,795

    i cannot use array in this project, moreover...

    i cannot use array in this project,
    moreover could you demonstratehowto walk downthe char using whileloop?
  12. Thread: bitwise rotation

    by sfff
    Replies
    9
    Views
    1,795

    bitwise rotation

    I am preparing a program for 8bits bitwise rotation in which the input character will shift right by one bit everytime, eg.
    when input "aaa", the result will be "-80 88 44"

    And then I came out...
  13. Thread: bitwise rotation

    by sfff
    Replies
    4
    Views
    2,599

    bitwise rotation

    Hi, i need to implement bitwise rotation (8 bits) (to the right) and I prepare the following

    while((ch=getchar()) != '\n')
    a=(ch>>1)|(ch>>(8-1));
    printf("%d ", a);

    however the result come...
  14. Replies
    7
    Views
    2,092

    Hi i have another question, I wanna carry out a...

    Hi i have another question,
    I wanna carry out a bit rotation (shift right to 1bits for 1st ASCII value, shift right 2bits for 2nd value and so on, until the 8th value with no bit rotation), how...
  15. Replies
    7
    Views
    2,092

    okay i see , thx

    okay i see , thx
  16. Replies
    7
    Views
    2,092

    this is exactly what I needed ! Thanks ! and I...

    this is exactly what I needed ! Thanks !

    and I guess the keyboard buffer could hold infinite keypress isn't it?

    by the way what's the purpose for the 2nd ch in the statement

    printf("\n %c...
  17. Replies
    7
    Views
    2,092

    getchar () and declare variable

    I need to write a program to turn the characters inputed into ASCII value and output the value,

    so i use getchar() and I encounter a problem.

    Because I getchar() only allow me to input a...
Results 1 to 17 of 17