Ejemplo n.º 1
0
int main(){
	char s[] = "aaaz";
	char t[] = "aaaa";
	char a[50];
	strncatt(s, t, 2); 
	strncppy(a, s, 3); 
	printf("%s\n", s);
	printf("%s\n", a);
	printf("Lexigraphical order: %d\n", strncmpp(s, t, 4));
	return 0;
}
Ejemplo n.º 2
0
int main () {
  char destination[MAXSIZE];
  int n = 2;
  printf("strncpyp with n=%d result: %s\n", n, strncpyp(destination, "apples", n));

  char destination2[MAXSIZE] = "crab";
  int m = 3;
  printf("strncatp with m=%d result: %s\n", m, strncatp(destination2, "apples", m));

  int o = 4;
  printf("strncmpp s1=%s and s2=%s result: %d\n", "applebees", "apletrees", strncmpp("applesbees", "appletrees", o));
  return 0;
}