copy a substring ?

hy again.

sorry for these basic question but i’m a bit confuse in C.
i can use strncpy();
but only the first x char in the string
now i would like to copy a substring, x char from a start point.

some like that :
var chaine=“toto est petit”
souschaine = chaine.substr(5,3);

result :
souschaine =“est”

i’m a but confused on pointers vs array

help will be greatly appreciate :-*

regards

mrbbp

well… thx for your help :wink:

I’ve found

strncpy(destinationString,&sourceString[n],number);

copy sourceString n (number) chars from char n+1 to destinationString…
in C strings are char array so [&] is for the adresse in memory of the begin of the array and we want the n+1 place in the array (the first is [0])…

1 week to find and 177 pages of a C langage’s Book :o

hope this help

eric