Dynamic Linked Lists and File Manipulation/assign5.c
StudentInfoPtr searchStudentName(StudentInfoPtr *head, const char *studentLastName) {
    
    StudentInfoPtr currentStudentInfoPtr = *head;
    
    while (currentStudentInfoPtr != NULL) {
        if(!strcmp(currentStudentInfoPtr->lastName, studentLastName)){
            return currentStudentInfoPtr;
        }
        currentStudentInfoPtr = (StudentInfoPtr) currentStudentInfoPtr->next;
    }  
        
    return NULL;
}
/*
    searchStudentName: searches the linked list for a student by last name
    input: the beginning of the linked list (head), the last name of student to be searched (studentLastName)
    output: the found student or NULL if not found
*/
searches the linked list for a student by last name
input: the beginning of the linked list (head), the last name of student to be searched (studentLastName)
output: the found student or NULL if not found
searches the linked list for a student by last name input : the beginning of the linked list ( head ) the last name of student to be searched ( studentLastName ) output : the found student or NULL if not found
StudentInfoPtr searchStudentName(StudentInfoPtr *head, const char *studentLastName) {
    StudentInfoPtr currentStudentInfoPtr = *head;
    while (currentStudentInfoPtr != NULL) {
        if(!strcmp(currentStudentInfoPtr->lastName, studentLastName)){
            return currentStudentInfoPtr;
        }
        currentStudentInfoPtr = (StudentInfoPtr) currentStudentInfoPtr->next;
    }  
    return NULL;
}
StudentInfoPtr searchStudentName ( StudentInfoPtr * head , const char * studentLastName ) { StudentInfoPtr currentStudentInfoPtr = * head ; while ( currentStudentInfoPtr != NULL ) { if ( ! strcmp ( currentStudentInfoPtr -> lastName , studentLastName ) ) { return currentStudentInfoPtr ; } currentStudentInfoPtr = ( StudentInfoPtr ) currentStudentInfoPtr -> next ; } return NULL ; }
searchStudentName: searches the linked list for a student by last name
input: the beginning of the linked list (head), the last name of student to be searched (studentLastName)
output: the found student or NULL if not found
searchStudentName : searches the linked list for a student by last name input : the beginning of the linked list ( head ) the last name of student to be searched ( studentLastName ) output : the found student or NULL if not found