Search:

Type: Posts; User: JSteel

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Ha, finally I've gone through it - seems like...

    Ha, finally I've gone through it - seems like numbers also worked with that, and the value of my variable was used as well.
    I'm finally done with this project. Thanks A LOT anyone who provided help...
  2. Now, and this is the final part of my project:...

    Now, and this is the final part of my project: once I've got the best response for both my IP's and DNS servers, I must compare them and, if IP shows a faster time of response, replace the DNS server...
  3. Got it on my own! My extraction of DNS servers...

    Got it on my own! My extraction of DNS servers lacked a fclose at the end of it. :wink: I was close to insanity...
  4. Double posted and asked some further nonsense,...

    Double posted and asked some further nonsense, haha. Sorry for the hassle.
    Now, after having spent my time modularizing the whole program, my main looks like this:


    int main()
    {

    FILE*...
  5. Update: I've tried out, through a different file...

    Update: I've tried out, through a different file and folder (where I've copied the same dns_responden.txt file) the following code, in order to follow laserlight's signature hint. Compiles and works...
  6. Hey laserlight! Thanks for your input. True about...

    Hey laserlight! Thanks for your input. True about the names but, as with the rest of the code, I just wanted to transpose the previous block with slightly different nomenclature in order to avoid...
  7. Yes, sorry. I've tried to simplify working in...

    Yes, sorry. I've tried to simplify working in different modules now.

    First one should export to dns_responden.txt those DNS servers. Working fine so far:


    void extraerDNS() {

    FILE*...
  8. Now, almost there... Trying to pick the DNS...

    Now, almost there...

    Trying to pick the DNS server that coincides with the lower average time value. This worked well with my IP block:


    int best_response = 0;
    char...
  9. Got it! printf("Average time...

    Got it!


    printf("Average time of response: %s ms.\n", dns_s1);

    How foolish of me printing an int with %s!:)
  10. Works as a charm, mate! Thanks again! Now I'm in...

    Works as a charm, mate! Thanks again!
    Now I'm in a different problem:


    printf("\n\DNS: %s\n", ip_str);
    int dns_s1 = velocidad_media(ip_str);
    ...
  11. Thanks a lot for your response again. Didn't...

    Thanks a lot for your response again. Didn't compile well so I just added some ending commas and initialized the variables a, b, c and d. Don't know if I did it well, since it crashes when...
  12. Hey John, thanks a lot once again for your...

    Hey John, thanks a lot once again for your response.
    Many concepts escaping my understanding there, so it's a bit of copying/pasting blindly this time. I guess I just need to modify that "input.txt"...
  13. Extracting and comparing DNS servers from a .txt file

    I've already gotten my code to obtain the best option (lower integer as time of response) out of different IP's stored in a .txt file, line after the other with line breaks between them. Now, I've...
  14. Replies
    29
    Views
    12,132

    Still trying to solve my loop but I feel I'm...

    Still trying to solve my loop but I feel I'm close to it.


    int best_response = velocidad_media(fgets(ipresp, sizeof(ipresp), responses));
    char best_ip;
    responses =...
  15. Replies
    29
    Views
    12,132

    Still stuck in a loop. :D I've asked my teacher...

    Still stuck in a loop. :D
    I've asked my teacher and he gave me some guidelines, including a new line which includes a new variable, namely response2 here, but still unable to fix this part....
  16. Replies
    29
    Views
    12,132

    I've finally come across the solution by myself,...

    I've finally come across the solution by myself, due to an annoying \n out there. As for temporary files, no worries, I'll do well with normal redirection.

    Now, that I'm almost there, I need one...
  17. Replies
    29
    Views
    12,132

    Ha, the tmp conversion is troublesome, indeed....

    Ha, the tmp conversion is troublesome, indeed. I'm following this route:


    FILE* tmp = tmpfile();
    while (fgets(ch, sizeof(ch), fp))
    {
    printf("Lanzando ping a %s", ch);
    ...
  18. Replies
    29
    Views
    12,132

    Thanks a lot once again, Salem. Worked perfectly....

    Thanks a lot once again, Salem. Worked perfectly. Now my code looks like this:


    fp = fopen(x, "r");
    FILE* responses = fopen("ips_responden.txt", "w"); // FILE* tmp = tmpfile();
    ...
  19. Replies
    29
    Views
    12,132

    Guess who's back...;) I need a slight...

    Guess who's back...;)
    I need a slight modification of this piece for a different program.



    Instead of printing "The IP responds...", I should redirect the IP whose ping has shown success in...
  20. Replies
    29
    Views
    12,132

    Sorry for the annoyance, but after some time of...

    Sorry for the annoyance, but after some time of struggle I think I'm almost there and it's annoying indeed not finding how...

    So now I have:


    #define _CRT_SECURE_NO_WARNINGS
    #include...
  21. Replies
    29
    Views
    12,132

    Ha, sorry for my insistence. I've reworked my...

    Ha, sorry for my insistence. I've reworked my code, implementing john.c's instead of that of the previous post (which proved to be a bit problematic). So far:


    #define _CRT_SECURE_NO_WARNINGS...
  22. Replies
    29
    Views
    12,132

    I'm back, sir. ;) Now that I've got the other...

    I'm back, sir. ;)
    Now that I've got the other two modules straight, I'm having some more hard time for a switch menu that allows me selecting among my different network adapters and, once selected,...
  23. Replies
    10
    Views
    7,899

    Yeah, sure. That was easy indeed, I might be too...

    Yeah, sure. That was easy indeed, I might be too fed up with all this homework to even function properly, and I'm taking note of the quote thing as well. Cheers and, once again, thanks for your...
  24. Replies
    10
    Views
    7,899

    Man, that works wonderfully. I've finally...

    Man, that works wonderfully. I've finally implemented the latter to my code and modified quite some things but works excellently. Only one more thing: would it be possible to store those numbers as...
  25. Replies
    10
    Views
    7,899

    Oh, yes, my bad. That output file I'm scanning...

    Oh, yes, my bad.
    That output file I'm scanning would look like:



    I would need to extract the last number in the last line after the "Media = " substring, minus the "ms" unit. In this case, the...
Results 1 to 25 of 39
Page 1 of 2 1 2