Quotation marks and strings - in C
Hello,
I writing a program, and I don't know how to insert quotation marks in my code. For example, Code:
#include <stdio.h> Any help would be appreciated. Lazyuser |
You have to put in an escape sequence to get a literal double-quote:
Code:
char url[100] = "\"http://www.google.com\""; |
Thank you for your quick reply, and it worked.
Thanks Lazyuser |
Hello, I have a new problem, if anybody can help.
Code:
#include <stdio.h> --04:21:04-- ftp://%22http//www.google.com%22 => `www.google.com"' Resolving %22http... failed: Host not found. Why is it adding %22 to my code. When I print it, it works. 22 in hex, is the quotation marks, why is it changing them. It compiles fine. Lazyuser |
sounds like wget is translating the chracters to me.
|
You wouldn't need the double quotes in the argument, would you?
Code:
[root@inet root]# wget http://www.google.com |
All times are GMT -5. The time now is 03:33 PM. |