1

When I use check50 to check my parse function, I find that check50 fails multiple tests and that the terminal generates multiple errors. I am using strtok to separate the request line into different variables. Is this causing the errors? Thank you in advance.

Here is my code:

// edited out per @MARS answer

1 Answer 1

1

Your question is too extensive, I am not a person who likes to reprimand anyone, but the work of debugging the program has to leave you, the time required to check and respond to all errors is very extensive, and this back out to most people. That said I will try to give you the tools necessary to use GDB. At first it is necessary to use check50 1 and check50 2, as the specifications say, to check the different functions separately.

the way to do, using GDB from the command line:

5
  • Alright, thank you. That is understandable. :-) Commented Dec 9, 2016 at 20:53
  • I have a question: whenever I use curl -i, it returns 400 Bad Request, even when I put in the same code as you showed above. When I go to CS50 IDE then Web Server, it shows the same thing. Is there anything I can do to fix this? I've inserted printf's in my code and I want to test it, but I've been stuck on how to actually test my code. Commented Dec 12, 2016 at 20:01
  • Well, I suppose it's my fault for not explaining myself well, If we use GDB from the command line (sorry if you find it uncomfortable, but this is how I learned), Each line that appears is the next line to be executed, so when "if (conected ()" appears, that line has not yet been executed, so we must type the next (n) command again, if you wrote before we can just press "enter", and the last written comma will be repeated. GBD from the command line is a powerful program for debugging with incredible features, it is worth handling with ease.
    – MARS
    Commented Dec 12, 2016 at 20:15
  • in the end you will see that you can not live without GDB. Good luck and enjoy the problem.
    – MARS
    Commented Dec 12, 2016 at 20:15
  • I'm afraid I didn't specify my problem like I should've. I was trying to access the web browser outside of GDB to see my progress so far, but it won't work. Thank you for explaining GDB. I find it rather difficult to work with, but I'm trying to get used to it! Commented Dec 12, 2016 at 20:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .