online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <stdio.h> #include <string.h> char*s= "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">" "<html>" "<head>" "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">" "<title>Aufgabe 4</title>" "</head>" "<body>" "<h1><a name=\"Ueberschrift\">Praktische Informatik III</a></h1>" "<p>Zu ignorierender text am Anfang</p>" "" "<p><a href=\"http://www2.informatik.hu-berlin.de/sam\" name=\"Werbung\">Lehrstuhlseiten - sollten ausgegeben werden.</a" "></p>" "<p>Zu ignorierender Text in der Mitte</p>" "<p><a name=\"Keine URL sondern nur einfacher Anker\">Dieser Text soll ignoriert werden, da der Anker keine URL enthält</a ></p>" "" "<p>Zu ignorierender Text in der Mitte</p>" "<p><a name=\"Grundwissen\" href=\"http://www.userfriendly.org\">Userfriendly - sollte jeder Informatiker kennen (und daher sollte dieser Text auch ausgegeben werden :-)</a ></p>" "" "<p>Zu ignorierender Text am Ende</p>" "</body>" "</html>"; int main() { FILE *f=fmemopen(s,strlen(s),"r"); char a[1000],b[1000],c[1000],d[1000]; while( fscanf(f,"%999s",a)==1 ) if(strstr(a,"<a")==a+strlen(a)-2) if(fscanf(f,"%999[^>]>",b)==1) if(strstr(b,"href=")) if(1==sscanf(strchr(strstr(b,"href="),'\"')+1,"%[^\"]\"",c)) { if(fscanf(f,"%999[^<]<",d)==1) printf("%s\n\t%s\n",c,d); } fclose(f); return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue