Well, since this works so nicely, I thought I would include the complete, working demo function here... however, apparently, I cannot actually attach a file in a message, so I will just link to the file in my Github repository, in the program that it will be used in.
Declare a structure "Student" which contains the following information:
Grade for5 subjects
2. Write a function to
search for a Student ID and if exists write "Found", otherwise, write "Not Found"
Write the Student found (ID and Grade) to a file with file name "StudentFile.txt
In the main (0 function:
Read the data of an array of 10 students from the user (i.e., keyboard)
Read from the user a student ID to search for
Invoke the function search to search for the Student ID read by the user
Sorry, I don't understand what you try to accomplish. Are you trying to document how your library has to be used by a client program? In this case, I've seen instructions like:
"... place an include directive to <cool_library.h> in your program"
"... place an include directive to <cool_library.h> before the include directive for <not_so_cool.h>"
If you are looking for something else, try to explain more.
It is still not clear what you mean by "the process". There is no process as such, you just need to ensure that the compiler can find all declarations and/or definitions of any functions that you are trying to use. Either within your source file or in an associated header.
The source code may be using definitions of classes/functions etc in an external library. The header file provides this information so the compiler can create a reference in the object code. Such references will then be used by the linker to fix the links to a library or other object code module. For example given the followin directory structure:
you might have:
// Library.h the defintions of the library, in the LIB subdirectory
void Foo(char* name);
// Library.c the implementation of the library, in the LIB subdirectory
void Foo(char* name)
printf("Hello, World! A message from %s\n", name);
//Implementor.cpp the program that will use the library, in the CLIENT subdirectory
#include"../LIB/Library.h"int main(int argc, char** argv)