Copy every single character from a char into another char.
Hey guys,
I have some problems with copying a single character from one char into another. How do I do that? I'm quite the beginner, so I would appreciate your help.
Here is the function I am using
Code:
void
text_col (char line[])
{
char line1[1];
int l, ii;
l = strlen(line);
//looping through the word - each character
for (ii=0;ii<l;ii++){
//This is my attempt to copy a character
strcpy (line1[0], line[ii]);
}
}
I am trying to copy in a loop every single character from char line into char line1. That is not working.
Can you tell me why and how I can fix it?
Thank you very much!