online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/***** Zmienne i funkcje statyczne *****/ #include <iostream> using namespace std; /***** Zmienna statyczna w funkcji. Raz zadeklarowana, będzie trwać do końca, pamiętając wartość. Inicjalizacja tylko za pierwszym razem. *****/ int myCounter () { static int N_of_calls = 0; return ( ++N_of_calls ) ; } /***** Zmienna statyczna poza funkcją "żyje" tylko w tym pliku *****/ static int myStatic = 1234; /***** Funkcja statyczna "żyje" tylko w tym pliku *****/ static void myFunction () { cout << "\n Wywolujemy statyczna funkcje myFunction(). \n\n"; } int main () { cout << "\n Twoja zmienna statyczna wynosi: " << myStatic << endl; myFunction(); for (int i = 1; i < 10; i++) cout << " Funkcja myCounter wywolana " << myCounter() << " razy.\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