Help with writing a pthread program in C
Create a text file which contains 5 names, 5 ages’, and 5 cities. Each word and number should start in a new line as shown below.
Amber
John
Damien
Paul
Kyle
sydney
melbourne
canberra
perth
darwin
20
23
21
32
24
I need to write a C program to read those 3 categories by using 3 separate threads and display them on the terminal. The lines that were displayed must be written into a shared memory location (RAM), which should be accessible from another process later.
I tried this a lot but I cant get it to work. If someone could write the code for me that would mean a lot
Thank you.
sample output
Amber from Sydney. Age: 20
John from Melbourne. Age: 23
Damien from Canberra. Age: 21
Paul from Perth. Age: 32
Kyle from Darwin. Age: 24