I have this C code:
#include <stdio.h>
int main() {
char text[] = "Some random text";
int counter = 0;
for(int i=0; i < sizeof text / sizeof (char); i++) {
printf("%c", text[i]);
counter++;
}
printf("\n%d", counter);
}
But the VSCode console only shows the text ("Some random text"). The printf for 'counter' is not working.
If I execute it out of VSCode, by clicking the .exe file, it works fine (in DevC++ too). Any idea?