Hi i undestand that in C you can not return an array, but a pointer to an array. But i am having trouble doing this, this is what i have done do far:
doing this the compiler gives me the following warning: "Suspicious pointer conversion in function numberCon" and also the incorrect values are printed out.Code:char * numberCon() { char numbers[10] for() { //adds numbers into the array } return numbers; } int main() { char * pt = numberCon(); int i =0; for(;i<10;i++) { printf("%d", &pt); pt++; } }
Any help would be great.