online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
/****************************************************************************** Online C Compiler. Code, Compile, Run and Debug C program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <stdio.h> #include <string.h> int main() { char string[100]; char buchstabe; int positionen[100]; int anzahl = 0; int i; printf("Gib einen String ein: "); fgets(string, sizeof(string), stdin); printf("Gib den Buchstaben ein, nach dem gesucht werden soll: "); scanf("%c", &buchstabe); // Durchlaufe den String und suche nach dem Buchstaben for (i = 0; i < strlen(string); i++) { if (string[i] == buchstabe) { positionen[anzahl] = i; anzahl++; } } // Gib die Anzahl und Positionen aus printf("Der Buchstabe '%c' kommt %d Mal vor.\n", buchstabe, anzahl); if (anzahl > 0) { printf("Positionen: "); for (i = 0; i < anzahl; i++) { printf("%d ", positionen[i]); } printf("\n"); } 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