Why doesn't it work? Is there a easy solution for this?
Thanks!
Source code:
Code:#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char buffer[30]; //n = 12 static char list[] = "H,B,C,N,P,O,S,Se,F,Cl,Br,I"; int size = sizeof list; int i; for(i=0; i<size; i++) { strcpy(buffer,list[i]); printf("%s",buffer); } return 0; }
Error codes:
Code:C:\CPP\mypermutation2\main.c||In function 'main':| C:\CPP\mypermutation2\main.c|44|warning: passing argument 2 of 'strcpy' makes pointer from integer without a cast| c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\string.h|45|note: expected 'const char *' but argument is of type 'char'| ||=== Build finished: 0 errors, 1 warnings ===|



LinkBack URL
About LinkBacks


