[ create a new paste ] login | about

Link: http://codepad.org/02C6x4ea    [ raw code | output | fork ]

C, pasted on Sep 12:
1
2
3
4
5
6
7
8
9
10
11
12
#include <stdio.h>
#include <string.h>
int main( void ){
  char array[10] = "abcd/efgh";
  char* str1;
  char* str2;
  str1 = array;
  str2 = strchr( array, '/' );
  *str2 = '\0'; str2 += 2;
  printf( "str1=%s, str2=%s\n", str1, str2 );
  return 0;
}


Output:
1
str1=abcd, str2=fgh


Create a new paste based on this one


Comments: