Java postfix increment

I am having a bit of a confusion with the prefix and the postfix increment. I understand the expression is evaluated from the right hand side and prefix have more precedence i.e: Example 0 int i = 0; int a = 0; i = ++a + ++a + a++; System.out.println("i: "+i+" a:"+a); in above jvm… Read More Java postfix increment

Recursive function for outputing string

I have a following code: #include <stdio.h> void recursion(char *ptr) { if(*ptr!=’J’) recursion(ptr++); printf("%c",*ptr); } void main() { char v[]="!zenaJ"; char *ptr=v; recursion(ptr); } I would like to return Janez! trough the recursive function. I don’t have any errors when compiling. When I run the program I get an error "Segmentation fault (core dumped)". What… Read More Recursive function for outputing string