can i send a character to firefox

hi
i want to see the source code of a web page in my browser so i wrote this, using the shortcut ^U. I have no idea if this is correct in any way.. It can be compiled and run and i get these two warnings (using dev c++):
7:18 [Warning] unknown escape sequence '\P' 
7:18 [Warning] unknown escape sequence '\M' 

but nothing happens.
The source code of the program is
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include<stdio.h>
#include<stdlib.h>

int main(){
    char c;
    FILE *fp;
    if((fp=fopen("C:\Program Files (x86)\Mozilla Firefox\firefox.exe", "a+b"))==NULL)
                            exit(1);
    putc(0010101, fp);
    fclose(fp);
    
    c = getchar();
    
    return 0;

}
\ is used for special character like newline \n, tab \t, etc. To have a \ in a string you have to write \\.

"C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"
If you can't figure out escape sequences in string literals you certainly don't have any business modifying an executable file, which is what you're attempting to do.

Learn to use google before trying to trash files on your system.
Last edited on
i googled it but i didn't find anything helpful. So, do you have any idea, how i can get the source code of a web page?
In firefox ctrl+u
That's odd. When I google I find several points from which to start.

Many of them lead to http://curl.haxx.se/libcurl/ or perhaps
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383630%28v=vs.85%29.aspx

But, actually reading a little from the googling might lead you to believe that it's not as straightforward as opening a file and writing an arbitrary value to it.
Topic archived. No new replies allowed.