0

I'm new in C, and I'm trying to do a Student Record Management. These are just the main parts that I want to work, I want the string from fullName, to be assigned on fN[50]. Thank you!

char* Student_Full_Name(){
    char *fullName[50];
    printf("Enter Full Name of Student: ");
    scanf("%s", fullName);
    return fullName;
}
int main(){
    char* fN[50]; 
    fn[50] = Student_Full_Name();
}
  • 1
    `fullName` is not a string, it's an array of pointers.`char fullName[50];` would be a string. – Barmar May 10 '22 at 01:32
  • `fN[50]` doesn't exist. Array indexes are 0-based, so the valid indexes of `fN` are 0 through 49. – Barmar May 10 '22 at 01:34

0 Answers0