I was trying to golf a simple code that ask for a word and repeat it without the first letters until the word is empty
For exemple :
hello
ello
llo
lo
o
I've made a code that work great :
#include <stdlib.h>
#include <stdio.h>
int main(){
char* p=(char*)(malloc(50*sizeof(char)));
scanf("%s",p);
while (*p!='\0',printf("%s\n",++p)>1);
}
But before, I first try a version with :while (*p!='\0',printf("%s\n",++p));
and when I try it, it was working great with the word inputed but then it started doing the same with my PATH
. So I was wondering why the program always prompt my PATH
? I'm on Windows 7 64-bits with mingw.
Thanks all ! Have a good day !