Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I'm attempting a question to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the d...
#13: Post edited
- I'm attempting a [question](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566) to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for `story.title`, `story.author` & `story.subject` (I'm not sure if I'm doing it right too). Can anyone help me out? (Also my title, author and book should not exceed 49 characters)
- I'm attempting a [question](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566) to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for `story.title`, `story.author` & `story.subject` (I'm not sure if I'm doing it right too). Can anyone help me out? (Also my title, author and book should not exceed 49 characters)
- ```
- #include<stdio.h>
- #include<stdlib.h>
- //#define MAX 49
- int main (void){
- FILE *cfPtr;
- struct book{ //the data structure that I am required to use
- char *title;
- char *author;
- char *subject; //subject[]
- };
- int operation;
- if ((cfPtr = fopen("library.dat","w")) == NULL){
- printf("File could not be opened...\n");
- }
- else {
- struct book aBook;
- struct book *aPtr;
- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
- printf("Enter operation number:");
- scanf("%d", &operation)
- switch(operation){
- case 1:
- printf("Title:\n");
- scanf("%s", title);
- printf("Author:");
- scanf("%s", author);
- printf("Subject:");
- scanf("%s", subject);
- break;
- case 2:
- printf("Enter Title:");
- scanf("%s", Title);
- //Incomplete coding (still working on it)
- //I'm planning to use switch case by looking at the question but I also have to use linked lists
- fprintf(cfPtr, "%s %s %s\n", title, author, subject);
- }
- fclose(cfPtr);
- return 0;
- }
#12: Post edited
I'm attempting a [question](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566) to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for `aBook.title`, `aBook.author` & `aBook.subject` (I'm not sure if I'm doing it right too). Can anyone help me out? (Also my title, author and book should not exceed 49 characters)
- I'm attempting a [question](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566) to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for `story.title`, `story.author` & `story.subject` (I'm not sure if I'm doing it right too). Can anyone help me out? (Also my title, author and book should not exceed 49 characters)
#11: Post edited
- I'm attempting a [question](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566) to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for `aBook.title`, `aBook.author` & `aBook.subject` (I'm not sure if I'm doing it right too). Can anyone help me out? (Also my title, author and book should not exceed 49 characters)
#include<stdio.h>#include<stdlib.h>//#define MAX 49int main (void){FILE *cfPtr;struct book{ //the data structure that I am required to usechar *title;char *author;char *subject; //subject[]};int operation;if ((cfPtr = fopen("library.dat","w")) == NULL){printf("File could not be opened...\n");}else {struct book aBook;struct book *aPtr;aBook.title = ""; //how should I write in the double quotes?aBook.author = "";aBook.subject = "";printf("Enter operation number:");scanf("%d", &operation)switch(operation){
- I'm attempting a [question](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566) to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for `aBook.title`, `aBook.author` & `aBook.subject` (I'm not sure if I'm doing it right too). Can anyone help me out? (Also my title, author and book should not exceed 49 characters)
#10: Post edited
Regarding the implementation of data structures.
![Question Part 1](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566)Hi, I'm attempting a question to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for aBook.title, aBook.author & aBook.subject (I'm not sure if I'm doing it right too). Can anyone help me out? thanks~ (Also my title, author and book should not exceed 49 characters)```- #include<stdio.h>
- #include<stdlib.h>
- //#define MAX 49
- int main (void){
- FILE *cfPtr;
- struct book{ //the data structure that I am required to use
- char *title;
- char *author;
- char *subject; //subject[]
- };
- int operation;
- if ((cfPtr = fopen("library.dat","w")) == NULL){
- printf("File could not be opened...\n");
- }
- else {
- struct book aBook;
- struct book *aPtr;
- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
- printf("Enter operation number:");
- scanf("%d", &operation)
- switch(operation){
- I'm attempting a [question](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566) to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for `aBook.title`, `aBook.author` & `aBook.subject` (I'm not sure if I'm doing it right too). Can anyone help me out? (Also my title, author and book should not exceed 49 characters)
- #include<stdio.h>
- #include<stdlib.h>
- //#define MAX 49
- int main (void){
- FILE *cfPtr;
- struct book{ //the data structure that I am required to use
- char *title;
- char *author;
- char *subject; //subject[]
- };
- int operation;
- if ((cfPtr = fopen("library.dat","w")) == NULL){
- printf("File could not be opened...\n");
- }
- else {
- struct book aBook;
- struct book *aPtr;
- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
- printf("Enter operation number:");
- scanf("%d", &operation)
- switch(operation){
#9: Post edited
- ![Question Part 1](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566)
- Hi, I'm attempting a question to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for aBook.title, aBook.author & aBook.subject (I'm not sure if I'm doing it right too). Can anyone help me out? thanks~ (Also my title, author and book should not exceed 49 characters)
- ```
- #include<stdio.h>
- #include<stdlib.h>
- //#define MAX 49
- int main (void){
- FILE *cfPtr;
- struct book{ //the data structure that I am required to use
- char *title;
- char *author;
- char *subject; //subject[]
- };
- int operation;
- if ((cfPtr = fopen("library.dat","w")) == NULL){
- printf("File could not be opened...\n");
- }
- else {
- struct book aBook;
- struct book *aPtr;
- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
- printf("Enter operation number:");
- scanf("%d", &operation)
- switch(operation){
case 1:printf("Title:\n");scanf("%s", title);printf("Author:");scanf("%s", author);printf("Subject:");scanf("%s", subject);break;case 2:printf("Enter Title:");scanf("%s", Title);//Incomplete coding (still working on it)//I'm planning to use switch case by looking at the question but I also have to use linked listsfprintf(cfPtr, "%s %s %s\n", title, author, subject);}fclose(cfPtr);return 0;}
- ![Question Part 1](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566)
- Hi, I'm attempting a question to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for aBook.title, aBook.author & aBook.subject (I'm not sure if I'm doing it right too). Can anyone help me out? thanks~ (Also my title, author and book should not exceed 49 characters)
- ```
- #include<stdio.h>
- #include<stdlib.h>
- //#define MAX 49
- int main (void){
- FILE *cfPtr;
- struct book{ //the data structure that I am required to use
- char *title;
- char *author;
- char *subject; //subject[]
- };
- int operation;
- if ((cfPtr = fopen("library.dat","w")) == NULL){
- printf("File could not be opened...\n");
- }
- else {
- struct book aBook;
- struct book *aPtr;
- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
- printf("Enter operation number:");
- scanf("%d", &operation)
- switch(operation){
#8: Post edited
Regarding the implementation of data structures.
Hi, I'm attempting a question to do with data structures, file streams & linked lists.> Nvm I solved it :)aBook.title = ""; //how should I write in the double quotes?aBook.author = "";aBook.subject = "";
- ![Question Part 1](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566)
- Hi, I'm attempting a question to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for aBook.title, aBook.author & aBook.subject (I'm not sure if I'm doing it right too). Can anyone help me out? thanks~ (Also my title, author and book should not exceed 49 characters)
- ```
- #include<stdio.h>
- #include<stdlib.h>
- //#define MAX 49
- int main (void){
- FILE *cfPtr;
- struct book{ //the data structure that I am required to use
- char *title;
- char *author;
- char *subject; //subject[]
- };
- int operation;
- if ((cfPtr = fopen("library.dat","w")) == NULL){
- printf("File could not be opened...\n");
- }
- else {
- struct book aBook;
- struct book *aPtr;
- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
- printf("Enter operation number:");
- scanf("%d", &operation)
- switch(operation){
- case 1:
- printf("Title:\n");
- scanf("%s", title);
- printf("Author:");
- scanf("%s", author);
- printf("Subject:");
- scanf("%s", subject);
- break;
- case 2:
- printf("Enter Title:");
- scanf("%s", Title);
- //Incomplete coding (still working on it)
- //I'm planning to use switch case by looking at the question but I also have to use linked lists
- fprintf(cfPtr, "%s %s %s\n", title, author, subject);
- }
- fclose(cfPtr);
- return 0;
- }
#7: Post edited
- Hi, I'm attempting a question to do with data structures, file streams & linked lists.
nvm I solved it :)- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
- Hi, I'm attempting a question to do with data structures, file streams & linked lists.
- > Nvm I solved it :)
- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
#6: Post edited
- Hi, I'm attempting a question to do with data structures, file streams & linked lists.
//nvm I solved itstruct book *aPtr;- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
- Hi, I'm attempting a question to do with data structures, file streams & linked lists.
- nvm I solved it :)
- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
#5: Post edited
![Question Part 1](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566)Hi, I'm attempting a question to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for aBook.title, aBook.author & aBook.subject (I'm not sure if I'm doing it right too). Can anyone help me out? thanks~ (Also my title, author and book should not exceed 49 characters)```#include<stdio.h>#include<stdlib.h>//#define MAX 49int main (void){FILE *cfPtr;struct book{ //the data structure that I am required to usechar *title;char *author;char *subject; //subject[]};int operation;if ((cfPtr = fopen("library.dat","w")) == NULL){printf("File could not be opened...\n");}else {struct book aBook;- struct book *aPtr;
- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
printf("Enter operation number:");scanf("%d", &operation)switch(operation){case 1:printf("Title:\n");scanf("%s", title);printf("Author:");scanf("%s", author);printf("Subject:");scanf("%s", subject);break;case 2:printf("Enter Title:");scanf("%s", Title);//Incomplete coding (still working on it)//I'm planning to use switch case by looking at the question but I also have to use linked listsfprintf(cfPtr, "%s %s %s\n", title, author, subject);}fclose(cfPtr);return 0;}
- Hi, I'm attempting a question to do with data structures, file streams & linked lists.
- //nvm I solved it
- struct book *aPtr;
- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
#4: Post edited
- ![Question Part 1](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566)
Hi, I'm attempting a question to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for aBook.title, aBook.author & a.Book subject (I'm not sure if I'm doing it right too). Can anyone help me out? thanks~ (Also my title, author and book should not exceed 49 characters)- ```
- #include<stdio.h>
- #include<stdlib.h>
- //#define MAX 49
- int main (void){
- FILE *cfPtr;
- struct book{ //the data structure that I am required to use
- char *title;
- char *author;
- char *subject; //subject[]
- };
- int operation;
- if ((cfPtr = fopen("library.dat","w")) == NULL){
- printf("File could not be opened...\n");
- }
- else {
- struct book aBook;
- struct book *aPtr;
- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
- printf("Enter operation number:");
- scanf("%d", &operation)
- switch(operation){
- case 1:
- printf("Title:\n");
- scanf("%s", title);
- printf("Author:");
- scanf("%s", author);
- printf("Subject:");
- scanf("%s", subject);
- break;
- case 2:
- printf("Enter Title:");
- scanf("%s", Title);
- //Incomplete coding (still working on it)
- //I'm planning to use switch case by looking at the question but I also have to use linked lists
- fprintf(cfPtr, "%s %s %s\n", title, author, subject);
- }
- fclose(cfPtr);
- return 0;
- }
- ![Question Part 1](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566)
- Hi, I'm attempting a question to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for aBook.title, aBook.author & aBook.subject (I'm not sure if I'm doing it right too). Can anyone help me out? thanks~ (Also my title, author and book should not exceed 49 characters)
- ```
- #include<stdio.h>
- #include<stdlib.h>
- //#define MAX 49
- int main (void){
- FILE *cfPtr;
- struct book{ //the data structure that I am required to use
- char *title;
- char *author;
- char *subject; //subject[]
- };
- int operation;
- if ((cfPtr = fopen("library.dat","w")) == NULL){
- printf("File could not be opened...\n");
- }
- else {
- struct book aBook;
- struct book *aPtr;
- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
- printf("Enter operation number:");
- scanf("%d", &operation)
- switch(operation){
- case 1:
- printf("Title:\n");
- scanf("%s", title);
- printf("Author:");
- scanf("%s", author);
- printf("Subject:");
- scanf("%s", subject);
- break;
- case 2:
- printf("Enter Title:");
- scanf("%s", Title);
- //Incomplete coding (still working on it)
- //I'm planning to use switch case by looking at the question but I also have to use linked lists
- fprintf(cfPtr, "%s %s %s\n", title, author, subject);
- }
- fclose(cfPtr);
- return 0;
- }
#3: Post edited
- ![Question Part 1](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566)
- Hi, I'm attempting a question to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for aBook.title, aBook.author & a.Book subject (I'm not sure if I'm doing it right too). Can anyone help me out? thanks~ (Also my title, author and book should not exceed 49 characters)
- ```
- #include<stdio.h>
- #include<stdlib.h>
- //#define MAX 49
- int main (void){
- FILE *cfPtr;
- struct book{ //the data structure that I am required to use
- char *title;
- char *author;
- char *subject; //subject[]
- };
- int operation;
- if ((cfPtr = fopen("library.dat","w")) == NULL){
- printf("File could not be opened...\n");
- }
- else {
- struct book aBook;
- struct book *aPtr;
- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
- printf("Enter operation number:");
- scanf("%d", &operation)
- switch(operation){
- case 1:
- printf("Title:\n");
- scanf("%s", title);
- printf("Author:");
- scanf("%s", author);
- printf("Subject:");
- scanf("%s", subject);
- break;
- case 2:
- printf("Enter Title:");
- scanf("%s", Title);
- //I'm planning to use switch case by looking at the question but I also have to use linked lists
- fprintf(cfPtr, "%s %s %s\n", title, author, subject);
- }
- fclose(cfPtr);
- return 0;
- }
- ![Question Part 1](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566)
- Hi, I'm attempting a question to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for aBook.title, aBook.author & a.Book subject (I'm not sure if I'm doing it right too). Can anyone help me out? thanks~ (Also my title, author and book should not exceed 49 characters)
- ```
- #include<stdio.h>
- #include<stdlib.h>
- //#define MAX 49
- int main (void){
- FILE *cfPtr;
- struct book{ //the data structure that I am required to use
- char *title;
- char *author;
- char *subject; //subject[]
- };
- int operation;
- if ((cfPtr = fopen("library.dat","w")) == NULL){
- printf("File could not be opened...\n");
- }
- else {
- struct book aBook;
- struct book *aPtr;
- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
- printf("Enter operation number:");
- scanf("%d", &operation)
- switch(operation){
- case 1:
- printf("Title:\n");
- scanf("%s", title);
- printf("Author:");
- scanf("%s", author);
- printf("Subject:");
- scanf("%s", subject);
- break;
- case 2:
- printf("Enter Title:");
- scanf("%s", Title);
- //Incomplete coding (still working on it)
- //I'm planning to use switch case by looking at the question but I also have to use linked lists
- fprintf(cfPtr, "%s %s %s\n", title, author, subject);
- }
- fclose(cfPtr);
- return 0;
- }
#2: Post edited
- ![Question Part 1](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566)
Hi, I'm attempting a question to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for aBook.title, aBook.author & a.Book subject (I'm not sure if I'm doing it right too). Can anyone help me out? thanks~ (Also my title, author and book should not exceed 49 characters, how should I do this?)- ```
- #include<stdio.h>
- #include<stdlib.h>
- //#define MAX 49
- int main (void){
- FILE *cfPtr;
- struct book{ //the data structure that I am required to use
- char *title;
- char *author;
- char *subject; //subject[]
- };
- int operation;
- if ((cfPtr = fopen("library.dat","w")) == NULL){
- printf("File could not be opened...\n");
- }
- else {
- struct book aBook;
- struct book *aPtr;
- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
- printf("Enter operation number:");
- scanf("%d", &operation)
- switch(operation){
- case 1:
- printf("Title:\n");
- scanf("%s", title);
- printf("Author:");
- scanf("%s", author);
- printf("Subject:");
- scanf("%s", subject);
- break;
- case 2:
- printf("Enter Title:");
- scanf("%s", Title);
- //I'm planning to use switch case by looking at the question but I also have to use linked lists
- fprintf(cfPtr, "%s %s %s\n", title, author, subject);
- }
- fclose(cfPtr);
- return 0;
- }
- ![Question Part 1](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566)
- Hi, I'm attempting a question to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for aBook.title, aBook.author & a.Book subject (I'm not sure if I'm doing it right too). Can anyone help me out? thanks~ (Also my title, author and book should not exceed 49 characters)
- ```
- #include<stdio.h>
- #include<stdlib.h>
- //#define MAX 49
- int main (void){
- FILE *cfPtr;
- struct book{ //the data structure that I am required to use
- char *title;
- char *author;
- char *subject; //subject[]
- };
- int operation;
- if ((cfPtr = fopen("library.dat","w")) == NULL){
- printf("File could not be opened...\n");
- }
- else {
- struct book aBook;
- struct book *aPtr;
- aBook.title = ""; //how should I write in the double quotes?
- aBook.author = "";
- aBook.subject = "";
- printf("Enter operation number:");
- scanf("%d", &operation)
- switch(operation){
- case 1:
- printf("Title:\n");
- scanf("%s", title);
- printf("Author:");
- scanf("%s", author);
- printf("Subject:");
- scanf("%s", subject);
- break;
- case 2:
- printf("Enter Title:");
- scanf("%s", Title);
- //I'm planning to use switch case by looking at the question but I also have to use linked lists
- fprintf(cfPtr, "%s %s %s\n", title, author, subject);
- }
- fclose(cfPtr);
- return 0;
- }
#1: Initial revision
Regarding the implementation of data structures.
![Question Part 1](https://software.codidact.com/uploads/wxoGToBH6tVpJFBLwBv7P566) Hi, I'm attempting a question to do with data structures, file streams & linked lists. The code isn't complete yet as I am still halfway working on it. I am required to use data structures in the declaration section like so as shown in my code below. However, I'm still confused on what I should include in the double quotes for aBook.title, aBook.author & a.Book subject (I'm not sure if I'm doing it right too). Can anyone help me out? thanks~ (Also my title, author and book should not exceed 49 characters, how should I do this?) ``` #include<stdio.h> #include<stdlib.h> //#define MAX 49 int main (void){ FILE *cfPtr; struct book{ //the data structure that I am required to use char *title; char *author; char *subject; //subject[] }; int operation; if ((cfPtr = fopen("library.dat","w")) == NULL){ printf("File could not be opened...\n"); } else { struct book aBook; struct book *aPtr; aBook.title = ""; //how should I write in the double quotes? aBook.author = ""; aBook.subject = ""; printf("Enter operation number:"); scanf("%d", &operation) switch(operation){ case 1: printf("Title:\n"); scanf("%s", title); printf("Author:"); scanf("%s", author); printf("Subject:"); scanf("%s", subject); break; case 2: printf("Enter Title:"); scanf("%s", Title); //I'm planning to use switch case by looking at the question but I also have to use linked lists fprintf(cfPtr, "%s %s %s\n", title, author, subject); } fclose(cfPtr); return 0; }