Ok... I know how to get a substring using the variable type "string," BUT... how do I get a substring of an array of characters.
For instance, if I have a character array of size 9, how do I pull out the first 4 characters?
but that just resizes the size of "temp2" instead of filling up the array with as many characters as it can and then stopping. "strcat" didn't work either! I just need the first 4 characters assigned to their own variable. I'm only asking the user for input once. I know its probably something simple. Please help if you can... thanks!Code:char temp1 = "temporary"; char temp2; strcpy (temp2 , temp1);