Student question: Can you keep the value of a variable in a helper function without malloc or returning the variable

Question: Can you keep the value of a variable in a helper function without malloc or returning the variable


Student question: How do I set the address of an int array to be an already declared integer

Question: How do I set the address of an int array to be an already declared integer


Student question: If node *next is a pointer to a node, what is the value of next.

Question: If node *next is a pointer to a node, what is the value of next.


Student question: If node *two is a pointer to a node, what is the value of two

Question: If node *two is a pointer to a node, what is the value of two


Question: Are structs classes?


Student question: If you pass an array to a function, do you need to use malloc to keep the changes to the array

Question: If you pass an array to a function, do you need to use malloc to keep the changes to the array


Student question: To keep changes to variables made in a function, do you pass a pointer to the variable

Question: To keep changes to variables made in a function, do you pass a pointer to the variable


Student question: How do I compare strings in

Question: How do I compare strings in


Student question: If I take a string as an argument in the function, can I use strlen on it

Question: If I take a string as an argument in the function, can I use strlen on it


Student question: If a function is given a string, can you directly edit the string in the function or do you need to use malloc

Question: If a function is given a string, can you directly edit the string in the function or do you need to use malloc


Student question: Does strcpy also copy the null terminator

Question: Does strcpy also copy the null terminator


Student question: Can I use strcat with a string and a character

Question: Can I use strcat with a string and a character


Student question: Can you use memset to set characters to null pointer

Question: Can you use memset to set characters to null pointer


Student question: How do I use malloc on a char * given to the function. How do I then assign characters to that char *.

Question: How do I use malloc on a char * given to the function. How do I then assign characters to that char *.


Student question: If I'm given a char * in a function, how do I make the changes stay outsides the function

Question: If I'm given a char * in a function, how do I make the changes stay outsides the function


Student question: If the parameter to my function is char *, how do I make changes to the variable that will stay in main.

Question: If the parameter to my function is char *, how do I make changes to the variable that will stay in main.


Goal: char *copy copies the string in *src to *dest, but it makes sure that *dest ends with a '\0'. capacity is supposed to be the maximum amount of characters copied to *dest, including the '\0' at the end. | Code context (simplify for kids): char *copy(char *dest, const char *src, int capacity) { dest = malloc(sizeof(char) * capacity); memset(dest, '\0', capacity); for(int i = 0; i < (capacity - 1); i++){ dest[i] = src[i]; } return dest; }


Goal: char *copy copies the string in *src to *dest, but it makes sure that *dest ends with a '\0'. capacity is supposed to be the maximum amount of characters copied to *dest, including the '\0' at the end. | Code context (simplify for kids): char *copy(char *dest, const char *src, int capacity) { dest = malloc(sizeof(char) * capacity); memset(dest, '\0', capacity); dest[capacity] = '\0'; for(int i = 0; i < (capacity - 1); i++){ dest[i] = src[i]; } return dest; }


Student question: Why don't my changes to dest remain in main? | Code context (simplify for kids): char *copy(char *dest, const char *src, int capacity) { dest = malloc(sizeof(char) * capacity); memset(dest, '\0', capacity); for(int i = 0; i < (capacity - 1); i++){ dest[i] = src[i]; } return dest; }

Question: Why don't my changes to dest remain in main?


Student question: How do I make changes to dest remain in main | Code context (simplify for kids): char *copy(char *dest, const char *src, int capacity) { dest = malloc(sizeof(char) * capacity); memset(dest, '\0', capacity); for(int i = 0; i < (capacity - 1); i++){ dest[i] = src[i]; } return dest; }

Question: How do I make changes to dest remain in main


Student question: Do you need to use malloc when changing the values of an array in a function

Question: Do you need to use malloc when changing the values of an array in a function


Student question: Can you change the value of a macro from the command line?

Question: Can you change the value of a macro from the command line?


Student question: How do I ask for equivalence to null

Question: How do I ask for equivalence to null


Student question: Does strlen include the null pointer

Question: Does strlen include the null pointer


Student question: If a function is given a **struct, is the actual struct: *struct

Question: If a function is given a **struct, is the actual struct: *struct


Student question: If I'm creating a struct, if I don't initialize the values, are they automatically set to null

Question: If I'm creating a struct, if I don't initialize the values, are they automatically set to null


Student question: If my struct has a variable that is a list of structs, can I set that value to NULL

Question: If my struct has a variable that is a list of structs, can I set that value to NULL


Student question: What is the else if statement in C called

Question: What is the else if statement in C called


Student question: How do I compare strings

Question: How do I compare strings


Student question: Let User be a struct. If I wanted a function to return a pointer to a User, would the return statement be *user_name or **user_name

Question: Let User be a struct. If I wanted a function to return a pointer to a User, would the return statement be *user_name or **user_name


Student question: Let char *name1 be a string. If I want a new char *name2 to be equal to name1, do I do char *name2 = *name1 or char *name2 = name1

Question: Let char *name1 be a string. If I want a new char *name2 to be equal to name1, do I do char *name2 = *name1 or char *name2 = name1


Student question: What does open return if a file doesn't exist

Question: What does open return if a file doesn't exist


Student question: If an object has a list of structs, how do I find the size of this list.

Question: If an object has a list of structs, how do I find the size of this list.


Student question: is an int the same as an unsigned integer

Question: is an int the same as an unsigned integer


Student question: Can I use index numbers to iterate through a list of structs

Question: Can I use index numbers to iterate through a list of structs


Student question: If User is a struct that has the variable: struct user *friends[MAX_FRIENDS], If new_user is an empty User, would I be able to do new_user->friends[32]; to initialize the array

Question: If User is a struct that has the variable: struct user *friends[MAX_FRIENDS], If new_user is an empty User, would I be able to do new_user->friends[32]; to initialize the array


Student question: If a macro is defined in a different file, but the same folder, can that macro value be accessed from a different file.

Question: If a macro is defined in a different file, but the same folder, can that macro value be accessed from a different file.


Student question: If *name is a string, do I do strlen(*name) or strlen(name)

Question: If *name is a string, do I do strlen(*name) or strlen(name)


Student question: Is a pointer to a NULL == NULL

Question: Is a pointer to a NULL == NULL


Student question: How do I print the contents f a file using fopen

Question: How do I print the contents f a file using fopen


Student question: How do I use time_t to record the time

Question: How do I use time_t to record the time


Student question: If I'm creating a function to free heap memory. Should I give the function the pointer to the variable or just the variable

Question: If I'm creating a function to free heap memory. Should I give the function the pointer to the variable or just the variable


Student question: What is the function that frees hap memory

Question: What is the function that frees hap memory


Student question: Am I freeing the right memory | Code context (simplify for kids): int remove_post(Post **head_post){ Post *head = *head_post; free(head); }

Question: Am I freeing the right memory


Student question: Am I freeing the right memory | Code context (simplify for kids): int remove_post(struct post **head_post){ free(**head_post); }

Question: Am I freeing the right memory


Student question: Am I freeing the right memory | Code context (simplify for kids): int remove_post(struct post **head_post){ struct post *head = *head_post; free(head); }

Question: Am I freeing the right memory


Student question: What memory am I freeing | Code context (simplify for kids): int remove_post(struct post **head_post){ free(*head); }

Question: What memory am I freeing


Student question: What memory am I freeing | Code context (simplify for kids): int remove_post(struct post **head_post){ free(*head_post); }

Question: What memory am I freeing


Student question: Am I freeing the right memory | Code context (simplify for kids): int remove_post(struct post **head_post){ free(*head_post); }

Question: Am I freeing the right memory


Student question: If I'm treeing to free the object, am I freeing the right memory | Code context (simplify for kids): int remove_post(struct post **post){ free(*post); }

Question: If I'm treeing to free the object, am I freeing the right memory


Student question: Is this valid: &(head->next)

Question: Is this valid: &(head->next)


Student question: If I have a struct user with the variable time_t *date, do I free free(&(head->date)) or free(head->date);

Question: If I have a struct user with the variable time_t *date, do I free free(&(head->date)) or free(head->date);


Student question: How do I set a char array after it's been initialized

Question: How do I set a char array after it's been initialized


Goal: Traverse through a linked structure to find a specific User | Code context (simplify for kids): User *find_user(const char *name, const User *head) { if(head == NULL){ return NULL; } User *curr = *head; if(strcmp(curr->name, name) == 0){ return *curr; } while(curr->next != NULL) curr = curr->next; if(strcmp(curr->name, name) == 0){ return *curr; } return NULL; }


Student question: How do I make scanf ignore spaces

Question: How do I make scanf ignore spaces


Student question: How do I make scanf ignore spaces but not \n

Question: How do I make scanf ignore spaces but not \n


Goal: Delete Posts in a linked structure recursively | Code context (simplify for kids): typedef struct user { char name[MAX_NAME]; char profile_pic[MAX_NAME]; // This is a *filename*, not the file contents. struct post *first_post; struct user *friends[MAX_FRIENDS]; struct user *next; } User; typedef struct post { char author[MAX_NAME]; char *contents; time_t *date; struct post *next;


Student question: What is the minimum value strcpy work with

Question: What is the minimum value strcpy work with


Student question: After declaring a char *, how do I fill it.

Question: After declaring a char *, how do I fill it.


Student question: Can you add a variable to the heap after having initialized it

Question: Can you add a variable to the heap after having initialized it


Student question: If I declare a char[15], does that mean 16 bytes are allocated to the char * as it has 15 bytes of characters as well as one byte for the null terminator?

Question: If I declare a char[15], does that mean 16 bytes are allocated to the char * as it has 15 bytes of characters as well as one byte for the null terminator?


Student question: Can you put '\n' as a character in a string

Question: Can you put '\n' as a character in a string


Student question: would the output of strlen("five") be four

Question: would the output of strlen("five") be four


Student question: Can you malloc something when it's value has already been assigned

Question: Can you malloc something when it's value has already been assigned


Student question: If I declare a char array like this: char name[x]; Would x be equivalent to the number of bits the array can hold

Question: If I declare a char array like this: char name[x]; Would x be equivalent to the number of bits the array can hold


Student question: If I have int array[3] = {1, 2, 3}; would the value of array be the pointer to the first int?

Question: If I have int array[3] = {1, 2, 3}; would the value of array be the pointer to the first int?


Student question: How do child processes return information to the parent process

Question: How do child processes return information to the parent process


Student question: Can you create a 2d array by using to square brackets

Question: Can you create a 2d array by using to square brackets


Student question: Is argc one more than the amount of inputs

Question: Is argc one more than the amount of inputs


Student question: If I'm using pipes pipes, and I want to read an int, do I give the address of the int

Question: If I'm using pipes pipes, and I want to read an int, do I give the address of the int


Student question: If I use pipes to read an integer, how do I use that integer from fd

Question: If I use pipes to read an integer, how do I use that integer from fd


Student question: If I'm reading a file, how do I make sure I read it line by line

Question: If I'm reading a file, how do I make sure I read it line by line


Student question: Do a lines of a file end with '\n' or '\0'

Question: Do a lines of a file end with '\n' or '\0'


Student question: If I have a FILE *fp, do I use fopen(fp, "r") to open the file for reading

Question: If I have a FILE *fp, do I use fopen(fp, "r") to open the file for reading


Student question: If I use fgets, and \n is the last index position of the string, does fgets replace \n with \0

Question: If I use fgets, and \n is the last index position of the string, does fgets replace \n with \0


Student question: Can you add index positions to an array

Question: Can you add index positions to an array


Student question: How do I use FSEEK to reset my file position to the top of the file

Question: How do I use FSEEK to reset my file position to the top of the file


Student question: How do I make sure I'm assigning a read-only string to a member of a struct so that I don't use more memory than is assigned to the struct

Question: How do I make sure I'm assigning a read-only string to a member of a struct so that I don't use more memory than is assigned to the struct


Student question: If I use strcpy, will the destination string will have different memory address than the source string?

Question: If I use strcpy, will the destination string will have different memory address than the source string?


Student question: If I do char *name = "bob"; will *name have the memory address of the read only memory of bob, meaning it's size will only be the size of a pointer?

Question: If I do char *name = "bob"; will *name have the memory address of the read only memory of bob, meaning it's size will only be the size of a pointer?


Student question: char *rule_names[max_rules]; Is this an array of pointers to strings?

Question: char *rule_names[max_rules]; Is this an array of pointers to strings?


Student question: How do I use FSEEK to go up one line a file without knowing the size of the line

Question: How do I use FSEEK to go up one line a file without knowing the size of the line


Student question: If I have code that is accepting input from a socket, and will stop when it detects "\r\n" using the function strstr, how do I print "\r\n" from input

Question: If I have code that is accepting input from a socket, and will stop when it detects "\r\n" using the function strstr, how do I print "\r\n" from input


Student question: char *flights[3]; Is this equivalent to a char **flights = malloc(3* sizeof(char *));

Question: char *flights[3]; Is this equivalent to a char **flights = malloc(3* sizeof(char *));


Student question: When trying to send a sigaction signal to a process from shell (assume it is SIGUSR1), is it: kill -USR1 pid or kill -SIGUSR1 pid

Question: When trying to send a sigaction signal to a process from shell (assume it is SIGUSR1), is it: kill -USR1 pid or kill -SIGUSR1 pid


Student question: is it chmod 555 file.txt or chmod file.txt 555

Question: is it chmod 555 file.txt or chmod file.txt 555


Student question: What is : cp ../*.in . do

Question: What is : cp ../*.in . do


Student question: if I do printf("%d", x); will it print the bit value of x

Question: if I do printf("%d", x); will it print the bit value of x


Student question: if you have char *name1 and char *name2; To set the address of name1 to name2, do you do name1 = name2;

Question: if you have char *name1 and char *name2; To set the address of name1 to name2, do you do name1 = name2;


Student question: if you have char *name1 and char *name2. To set the address of name1 to the address of name2, do you do name1 = name2;

Question: if you have char *name1 and char *name2. To set the address of name1 to the address of name2, do you do name1 = name2;


Student question: What does r+ do with fopen

Question: What does r+ do with fopen


Student question: I have this error with C program: phone.c:6:13: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[10]’ [-Wformat=] 6 | scanf("%s %d", &str, &num); | ~^ ~~~~ | | | | char * char (*)[10] how do i fix it?

Question: I have this error with C program: phone.c:6:13: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[10]’ [-Wformat=] 6 | scanf("%s %d", &str, &num); | ~^ ~~~~ | | | | char * char (*)[10] how do i fix it?


Student question: why wont this work? int main(int argc, char **argv) { char str[10]; int num; scanf("%s %d", str, &num); if (num == -1) { printf("%s", str); } else if (0 <= num && num < 10) { printf("%s", *(&str+num)); } else { printf("ERROR"); } }

Question: why wont this work? int main(int argc, char **argv) { char str[10]; int num; scanf("%s %d", str, &num); if (num == -1) { printf("%s", str); } else if (0 <= num && num < 10) { printf("%s", *(&str+num)); } else { printf("ERROR"); } }


Student question: how do you make an array of an array of strings in C

Question: how do you make an array of an array of strings in C


Student question: How to convert a string to an integer

Question: How to convert a string to an integer


Student question: How do I make a dynamically sized array in C

Question: How do I make a dynamically sized array in C


Student question: how to make an arraylist in C like python and how to append to it

Question: how to make an arraylist in C like python and how to append to it


Student question: what type is scanf output

Question: what type is scanf output


Student question: is the output of ls -l a string

Question: is the output of ls -l a string


Student question: how do you print an initialized integer

Question: how do you print an initialized integer


Student question: how do you skip a line in the input stream

Question: how do you skip a line in the input stream


Student question: how do i compile a file

Question: how do i compile a file


Student question: how do i put ls into standard input of a executable

Question: how do i put ls into standard input of a executable


Student question: can you alternate between fgets and fscan for the same file

Question: can you alternate between fgets and fscan for the same file


Student question: how do you remove the first element from a string

Question: how do you remove the first element from a string


Question: what is pipe in c


Student question: how to compile two programs at once

Question: how to compile two programs at once


Code context (simplify for kids): void fib(int **fib_sequence, int count){ *fib_sequence = malloc(sizeof(int) * count); if(count >= 1){ *fib_sequence[0] = 0; } printf("HI\n"); if(count >= 2){ *fib_sequence[1] = 1; int i; for(i = 2; i < count; i++){ *fib_sequence[i] = *fib_sequence[i - 1] + *fib_sequence[i - 2]; } } }


Student question: why am i getting a segmentation error | Code context (simplify for kids): void fib(int **fib_sequence, int count){ *fib_sequence = malloc(sizeof(int) * count); if(count >= 1){ *fib_sequence[0] = 0; } printf("HI\n"); if(count >= 2){ *fib_sequence[1] = 1; int i; for(i = 2; i < count; i++){ *fib_sequence[i] = *fib_sequence[i - 1] + *fib_sequence[i - 2]; } } }

Question: why am i getting a segmentation error


Student question: how to compare strings

Question: how to compare strings


Student question: does strlen include the null terminator

Question: does strlen include the null terminator


Question: how to trim a string


Student question: how to get a sub string

Question: how to get a sub string


Question: how to use strncat


Student question: is the struct stored in the stack

Question: is the struct stored in the stack


Student question: does strlen count the null terminator

Question: does strlen count the null terminator


Student question: how to use fopen to see if a file exists

Question: how to use fopen to see if a file exists


Student question: how to print an ascii file

Question: how to print an ascii file


Student question: why is there an infinite loop | Code context (simplify for kids): User *find_user(const char *name, const User *head) { User *curr = (User *)head; while(curr != NULL){ if (strcmp(curr->name, name) == 0){ return curr; } } return NULL; }

Question: why is there an infinite loop


Student question: what does the time function do

Question: what does the time function do


Question: how do u use st_mtim


Student question: Write a sample code for tim Sort using python

Question: Write a sample code for tim Sort using python


Student question: in c, how can i restrict scanf() to only read the first 10 characters inputed

Question: in c, how can i restrict scanf() to only read the first 10 characters inputed


Student question: what does char phone[11] mean?

Question: what does char phone[11] mean?


Student question: is this an array or string | Code context (simplify for kids): char file[31];

Question: is this an array or string


Student question: is this valid in c? | Code context (simplify for kids): char file; file = '1234';

Question: is this valid in c?


Goal: file should be a string | Code context (simplify for kids): char file; file = '1234';


Student question: in c, how can we read input from stand input in function main?

Question: in c, how can we read input from stand input in function main?


Student question: how can i concatenate a space to a string

Question: how can i concatenate a space to a string


Student question: how can i test if the pixels of a 24 bitmap is correctly printed out?

Question: how can i test if the pixels of a 24 bitmap is correctly printed out?


Student question: Any advices for aceing CSC209?

Question: Any advices for aceing CSC209?


Student question: any recommendation for vs code studio c language configuration?

Question: any recommendation for vs code studio c language configuration?


Student question: 'gcc' is not recognized as an internal or external command, operable program or batch file.

Question: 'gcc' is not recognized as an internal or external command, operable program or batch file.