Hi All!!!
My task is...
"Write a function that adds the elements of two one-dimensional arrays of same size. The results should be stored in a third function. The function should take as arguments the name of the three arrays and the array dimensions.
Write a simple program that uses the function. The two arrays should be declared at the beginning of the program (in the main function block)"
This is my code so far...
I have tried for ages but I cannot arrange my code in to the specified function as the task requires.Code:#define _CRT_SECURE_NO_DEPRECATE #include<stdio.h> #include<string.h> main() { char first[31]; char second[31]; char name[62]; printf("Please enter your first name(s): "); scanf("%[^\n]", first); printf("Please enter you surname(s): "); fflush(stdin); scanf("%[^\n]", second); strcpy(name, first); strcat(name, " "); strcat(name, second); printf("Your full name is %s", name); }
Can anyone please help??
Thanks in advance
Stuart



LinkBack URL
About LinkBacks


