Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

array to array

Status
Not open for further replies.

Guest
Hi,
I have to learn arrays and I am having trouble to
pass the "name" array into the "max_age_name" array.

Your help is very much appreciated
Andonny

if(maxage<age)
{
maxage=age;
while(name!='\0')
{
max_age_name=name;
printf(&quot;%c&quot;, max_age_name[i++]);
i++;
}
}
 
Replies continue below

Recommended for you

if name is a string(char * or an array of character) then you can use strcpy() function.

other way is to copy character by character. In your code array subscript is missing.
It should be :
max_age_name=name;
Regards,
Nkhiste.

 
hi, i have to find a sequence of characters in a 2D array. and having trouble of how to make the result of the char i want to display on screen.
table_1[6] {'\o', 'K', 'E', 'N', 'Z', '\o'}
table_2[6] {'\o', 'D', 'O', 'B', 'R', '\o'}
what should i do to make 'K', 'E', 'N' to display on screen?
 
Status
Not open for further replies.
Back
Top