Search:

Type: Posts; User: zacharyrs

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    30
    Views
    4,593

    But multiple searches would require 'r+'?

    But multiple searches would require 'r+'?
  2. Replies
    30
    Views
    4,593

    Ah! that makes perfect sense. Now it works...

    Ah! that makes perfect sense. Now it works perfectly with the 'r+'.
  3. Replies
    30
    Views
    4,593

    Weird, but great news: I changed 'a+' to 'r+' and...

    Weird, but great news: I changed 'a+' to 'r+' and it now works perfect.

    Thank you so much for your kind help. Now I'm going to go through and see what I can fix to make it better. If you have...
  4. Replies
    30
    Views
    4,593

    Thank you. I appreciate your help. However, I...

    Thank you. I appreciate your help. However, I have used the search term 'the' and it does not display the number of times it was in there. The count looks like it should be working so I'm not sure...
  5. Replies
    30
    Views
    4,593

    The problem is you are using code that we haven't...

    The problem is you are using code that we haven't been introduced to in class. It would make my prof asking questions, and I wouldn't even understand what I'm learning ;(

    Is my code that crappy...
  6. Replies
    30
    Views
    4,593

    Hmm. Looks like a lot of stuff I haven't learned...

    Hmm. Looks like a lot of stuff I haven't learned yet in C :( At this point I'm just trying to get my program to work as it is... I really appreciate your help.
  7. Replies
    30
    Views
    4,593

    Yeah I need to print - at the bottom of the text...

    Yeah I need to print - at the bottom of the text file - the mystring and target strings. that is why i was leaning towards the a+ cuz I thought it appended text at the end of the file?
  8. Replies
    30
    Views
    4,593

    "r" will allow me to "read" and "write" to the...

    "r" will allow me to "read" and "write" to the file?
  9. Replies
    30
    Views
    4,593

    At the bottom of the text file, I need to print...

    At the bottom of the text file, I need to print what they searched for and how many times it showed up. This is why I was using a+. Is this not correct?
  10. Replies
    30
    Views
    4,593

    Would the issue of not comparing be in this part?...

    Would the issue of not comparing be in this part?


    if(strcmp(mystring, target) == 0)
    count++;
  11. Replies
    30
    Views
    4,593

    Ah, the missing #include is what was...

    Ah, the missing #include<string.h> is what was making the string length not work. Thanks for that :)

    Also thanks Adak for pointing out the wrong string I'm looking for :) I really appreciate the...
  12. Replies
    30
    Views
    4,593

    Sorry, I am not exactly sure where I should...

    Sorry, I am not exactly sure where I should switch mystring for target regarding your reply.
  13. Replies
    30
    Views
    4,593

    My goal is to compare the user input (mystring)...

    My goal is to compare the user input (mystring) with the content of the text file (target). If they match then I need to keep a record (using my count variable) and print out how many times the user...
  14. Replies
    30
    Views
    4,593

    Hmm. Here is what I added: //compare our...

    Hmm. Here is what I added:


    //compare our strings
    do{
    //scan through file
    fscanf(cfile, "%s", mystring);

    //convert string to lowercase
    for(i = 0; i < /*strlen(mystring)*/ 300;...
  15. Replies
    30
    Views
    4,593

    Help with searching text file

    Hi all, I've gotten very close with my project and just need a fresh pair of eyes to point out the obvious. My code seems to parse through the text file, yet does not actually search correctly. My...
  16. Hmm. I think this is a bit more complex than what...

    Hmm. I think this is a bit more complex than what I'm needing. What about searching a text file for one or two words the user inputs (which would be a string in my case - but generally I'm just...
  17. Searching a specific string/word/etc in a text file?

    I am learning the joys of text file manipulation with C and having a blast :) However I am having issues trying to find information online on how to search (specifically a string in my case) in a...
  18. Replies
    10
    Views
    1,894

    Thank you for your help. Where would proper...

    Thank you for your help. Where would proper placement of the break be - outside loop or in the while?
  19. Replies
    10
    Views
    1,894

    I was able to set a variable and increase it each...

    I was able to set a variable and increase it each time to show the number of tries. Yay for me. Anyone know best way of stopping the loop when the user has guessed the number, thus ending the loop...
  20. Replies
    10
    Views
    1,894

    Would I create an int variable, then increase...

    Would I create an int variable, then increase each time in the loop?


    int numGuessed=0;

    and later in the loop just do



    That way it gets added each time it loops?
  21. Replies
    10
    Views
    1,894

    That is in place for the loop //increase the...

    That is in place for the loop


    //increase the loop until it meets the x variable
    i++;
  22. Replies
    10
    Views
    1,894

    Number Guessing Game Help?

    First, thank you for even thinking of helping me. I am a n00b at C and trying to learn every bit I can. I am seeking help so I can understand for future projects, not just an answer :) Also excuse my...
  23. Replies
    3
    Views
    15,418

    Storing Words in a Variable?

    How can I store an actual word with a variable? My ideal would be as thus:



    int main ()

    {
    //introduce variable
    whatvariable a;
  24. Ah yes, thank you.

    Ah yes, thank you.
  25. Worked perfectly. What command do I enter to end...

    Worked perfectly. What command do I enter to end my program?
Results 1 to 25 of 26
Page 1 of 2 1 2