Damn, you were faster.
Really not bad for a 5 h newbie!
But anyway here is my interpretation of the substring() function of JAVA. It's very basic and not secure!
Code:
#include <stdio.h>
int strll(char str[]);
void sub(char string[], int min, int max);
int main()
{
char str[10];
int start, end;
printf("String: ");
gets(str);
printf("\nstart: ");
scanf("%d", &start);
printf("\nend: ");
scanf("%d", &end);
sub(str,start-1,end-1);
return 0;
}
void sub(char string[], int min, int max)
{
int i;
for(i = min; i <= max; i++)
{
printf("%c", string[i]);
}
}