Can someone please tell what im doing wrong?
Here is the code:
Code:
#include <stdio.h>
#include <stdlib.h>
#define myArray "sc"
#define myChar 'c'
int main(int c, char** argv)
{
char myCharArray [ ] = myArray;
printf("%s\n", myCharArray);
char myArrayC [ ] = xo ();
printf("%s\n", myArrayC);
return 0;
}
char* xo ()
{
char moo [ ] = "scd";
char* xo = moo;
return xo;
}
And here are the errors i get:
Code:
linux3[32]% gcc -ansi test.c
test.c: In function `main':
test.c:12: error: invalid initializer
test.c: At top level:
test.c:19: error: conflicting types for 'xo'
test.c:12: error: previous implicit declaration of 'xo' was here
Thanks, This language is C by the way
Mistro116