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