when i tried to copy structure array of name into another string array i get this error message
warning: passing argument 1 of 'strcpy' makes pointer from integer without a cast

/* copying structure array name  into another string array*/
#include<stdio.h>
#include<string.h>


	int main(){

			
		int i=0;
		int j,k,l,m;
   		int choice=1;
                                char words[20];

	
		struct customer{

				char name[20];
				int account;
				int current;
	                     		int debt;
				
		}cu[20];

		
	       	
		printf("\n ******enter details******* \n");
                     while (choice==1){
				
	                	printf("\n enter customer detials\n");
			
			printf("\ncustomer name:");
			scanf("%s",&cu[i].name);
			printf("\n account no:");
			scanf(" %d",&cu[i].account);
			                        i++;
			printf("\n..enter 1 to continue");
			scanf("%d",&choice);
		}
                 /*copying  structure array name into array words*/			
                        for(m=0;m<i;m++){
			strcpy(words[m],cu[m].name);
	   }
             }

words[m] is just one char

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.