Reflecting while studying C language

Run the following C program

#include <stdio.h>
#include <string.h>
int main (int argc, char const *argv[]){
	if(!argv[1]) return 0;
	int i = strlen(argv[1]);
	while(i > -1){
		printf("%c",argv[1][i]);
		i--;
	}
	printf("\n");
}

Using this string as first program parameter:

"..eromyna ti ekat t'nac I ?nwod edispu semit ynam os dlrow eht si yhW"

7 Comments

Post a Comment

Your email is never shared. Required fields are marked *