0

I am trying to copy the first three characters of a character array into another character array of length 3.

For instance, if I use

char trig [10] = "cos(50)"; //declare and assign the char array "trig"

char t [3]; //declare char array t to store the "cos" part of the trig array

t[0] = trig[0];

t[1] = trig[1];

t[2] = trig[2];

Whenever I do this, I get 0012FF48 as a result. But of course I was expecting "cos". What's the deal?