Search:

Type: Posts; User: sjmp

Search: Search took 0.01 seconds.

  1. Replies
    17
    Views
    7,502

    Got it working! for real this time set \t and...

    Got it working! for real this time

    set \t and '' to state OUT
    set \n to increment and state out
    default if char increment and fixed the word count as another if statement proceeding that.
    ...
  2. Replies
    17
    Views
    7,502

    Andreas I removed c !=4 and it no longer...

    Andreas
    I removed c !=4 and it no longer responded to CNTRLD, I am using windows...
  3. Replies
    17
    Views
    7,502

    I was successful in counting words (ignoring...

    I was successful in counting words (ignoring tabs, spaces, newlines)
    using:


    if(c == '\n' || c == '\t' || c == ' ')
    state = OUT;
    else if(isalpha(c) && state ==...
  4. Replies
    17
    Views
    7,502

    Probably making things more of a mess, but trying...

    Probably making things more of a mess, but trying to get the word count to NOT increment from spaces, new lines, or tabs... tried adding this but still not working



    while((c = getchar()) !=...
  5. Replies
    17
    Views
    7,502

    need to terminate the program using CNTRL D -...

    need to terminate the program using CNTRL D - ASCII 4? that is what I was trying to do there. It works so long as long as I execute CNTRL D on a new line.
  6. Replies
    17
    Views
    7,502

    Tried to modify but \t still increments word....

    Tried to modify but \t still increments word. From my code I can understand why, just dont know exactly how to correct.





    switch (c)
    {
    case ' ':
    case...
  7. Replies
    17
    Views
    7,502

    nonoob - thank you. I tried to condense the code...

    nonoob - thank you. I tried to condense the code the only problem is that words will increment w/ tab or spaces...




    #include <stdio.h>
    #include <ctype.h>


    #define IN 1
  8. Replies
    17
    Views
    7,502

    It works now. It has been slow learning the...

    It works now.

    It has been slow learning the last few weeks and the fact that you could give me directions and I had the slightest clue to do something with those directions...makes me feel like I...
  9. Replies
    17
    Views
    7,502

    Thanks - that was helpful - I made the changes -...

    Thanks - that was helpful - I made the changes - now I get an infinite loop. If I type 'test' - infinite loop w/ Characters 1 (should be four) Lines:0 Words:0 - this happens w and w/o break;


    ...
  10. Replies
    17
    Views
    7,502

    Switch statement does not flow through cases

    I am brand new to programming (2 weeks strong ;)). I have to use a switch statement to output characters, lines and words. I have been using the same if statements for th assignment (while, do-while)...
Results 1 to 10 of 10