user_id stringlengths 24 24 | time stringlengths 24 24 | feature_type stringclasses 5
values | feature_version stringclasses 2
values | input_question stringlengths 1 1.24k ⌀ | input_code stringlengths 2 18.5k ⌀ | input_intention stringlengths 1 2.48k ⌀ | input_task_description stringlengths 18 3.32k ⌀ |
|---|---|---|---|---|---|---|---|
63c647695f004bf4898cf38d | 2023-02-13T01:25:44.446Z | Help Fix Code | v1 | null | /*
* Make a new post from 'author' to the 'target' user,
* containing the given contents, IF the users are friends.
*
* Insert the new post at the *front* of the user's list of posts.
*
* 'contents' is a pointer to heap-allocated memory - you do not need
* to allocate more memory to store the contents of the pos... | /*
* Make a new post from 'author' to the 'target' user,
* containing the given contents, IF the users are friends.
*
* Insert the new post at the *front* of the user's list of posts.
*
* 'contents' is a pointer to heap-allocated memory - you do not need
* to allocate more memory to store the contents of the pos... | null |
63c647695f004bf4898cf38d | 2023-02-13T01:59:51.672Z | Explain Code | v1 | null | /*
* Make a new post from 'author' to the 'target' user,
* containing the given contents, IF the users are friends.
*
* Insert the new post at the *front* of the user's list of posts.
*
* 'contents' is a pointer to heap-allocated memory - you do not need
* to allocate more memory to store the contents of the pos... | null | null |
63c647695f004bf4898cf38d | 2023-02-13T02:07:26.663Z | Help Fix Code | v1 | null | * Return:
* - 0 on success
* - 1 if users exist but are not friends
* - 2 if either User pointer is NULL
*/
int make_post(const User *author, User *target, char *contents) {
if (author == NULL || target == NULL) {
return 2;
}
if (!are_friends(author, target)) {
... | /*
* Make a new post from 'author' to the 'target' user,
* containing the given contents, IF the users are friends.
*
* Insert the new post at the *front* of the user's list of posts.
*
* 'contents' is a pointer to heap-allocated memory - you do not need
* to allocate more memory to store the contents of the pos... | null |
63c647695f004bf4898cf38d | 2023-02-13T20:26:37.587Z | Help Fix Code | v1 | null | FILE *file;
char line[4096];
file = fopen(user->profile_pic, "r");
while (fgets(line, 4096, file) != NULL) {
printf("%s", line);
}
fclose(file); | Open a file and print each line in the file to standard output | null |
63c647695f004bf4898cf38d | 2023-02-13T20:54:04.454Z | Help Fix Code | v1 | null | FILE *file;
char line[4096];
char string[32];
strncpy(string, user->profile_pic, 32);
file = fopen(string, "r");
while (fgets(line, 4096, file) != NULL) {
printf("%s", line);
}
fclose(file); | STORE the name of the file. Then you read the file and immediately print it back out. You can do this in pieces and never store the entire thing. If you think about it for a while, you will realize that you don't need to assume a maximum line length for using fgets. | null |
63c647695f004bf4898cf38d | 2023-02-15T05:44:24.782Z | Help Fix Code | v1 | null | int make_post(const User *author, User *target, char *contents) {
if (author == NULL || target == NULL) {
return 2;
}
if (!are_friends(author, target)) {
return 1;
}
Post *new_post = (Post *)malloc(sizeof(Post));
strcpy(new_post->author, a... | /*
* Make a new post from 'author' to the 'target' user,
* containing the given contents, IF the users are friends.
*
* Insert the new post at the *front* of the user's list of posts.
*
* 'contents' is a pointer to heap-allocated memory - you do not need
* to allocate more memory to store the contents of the pos... | null |
63c647695f004bf4898cf38d | 2023-03-14T01:46:47.061Z | Help Fix Code | v2 | You will need to use fork and execvp to the run the command specified by an action. Fortunately in Part 1, you already prepared the array of arguments to pass into execvp. The parent process should wait for each child to complete. If the child terminates with a non-zero exit status, the parent should also terminate wit... | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include "pmake.h"
void execute_action(Action *action) {
printf("%s\n", *action->args);
pid_t pid = fork();
if (pid == 0) {
execvp(action->args[0], action->args);
fp... | null | null |
63c6476a5f004bf4898cf397 | 2023-02-15T01:57:37.027Z | Help Fix Code | v1 | null | int create_user(const char *name, User **user_ptr_add) {
if (strlen(name)>= MAX_NAME){
return 2;
}
//Initializing a new user with name "name" and .next set to NULL to be added
User *new_user;
new_user = malloc(sizeof(struct user));
strncpy(new_user->name, name, MAX_NAME);
new_user... | * Create a new user with the given name. Insert it at the tail of the list
* of users whose head is pointed to by *user_ptr_add.
*
* Return:
* - 0 if successful
* - 1 if a user by this name already exists in this list
* - 2 if the given name cannot fit in the 'name' array
* (don't forget about the n... | null |
63c6476b5f004bf4898cf39c | 2023-01-24T01:28:52.498Z | General Question | v1 | syntax for strtol
| null | null | null |
63c6476b5f004bf4898cf39c | 2023-01-24T01:29:28.471Z | General Question | v1 | how does scanf work? | null | null | null |
63c6476b5f004bf4898cf39c | 2023-02-01T05:51:57.934Z | General Question | v1 | how does malloc work?
| null | null | null |
63c6476b5f004bf4898cf39c | 2023-02-14T08:59:26.715Z | General Question | v1 | what does strncpy do?
| null | null | null |
63c6476b5f004bf4898cf39c | 2023-02-14T09:00:30.196Z | Help Write Code | v1 | null | null | null | How does strncpy work?
|
63c6476b5f004bf4898cf39c | 2023-03-17T21:49:23.736Z | General Question | v2 | How does wait work?
| null | null | null |
63c6476b5f004bf4898cf39c | 2023-03-17T21:50:12.266Z | General Question | v2 | what are the attributes of the struct time_t | null | null | null |
63c6476b5f004bf4898cf39c | 2023-03-23T05:00:40.129Z | General Question | v2 | how does bind work
| null | null | null |
63c6476b5f004bf4898cf39c | 2023-03-23T05:01:25.269Z | Help Write Code | v2 | null | null | null | how to find a character in a character array without a null terminator |
63c6476e5f004bf4898cf3b5 | 2023-03-23T17:49:49.910Z | Help Fix Code | v2 | print hello world | print("Helloworld"); | null | null |
63c6476e5f004bf4898cf3b5 | 2023-03-23T17:50:48.733Z | Help Fix Code | v2 | print Hello world | printf("Hello world"); | null | null |
63c6476e5f004bf4898cf3b5 | 2023-03-23T17:51:13.198Z | Help Fix Code | v2 | print Hello world | printf("Hello world\n"); | null | null |
63c647705f004bf4898cf3c4 | 2023-02-14T16:40:01.041Z | General Question | v1 | what is valgrind?
| null | null | null |
63c647705f004bf4898cf3c4 | 2023-02-14T16:45:08.369Z | General Question | v1 | what is the best way to debug c code? | null | null | null |
63c647705f004bf4898cf3c4 | 2023-02-14T17:10:00.285Z | General Question | v1 | is a null pointer different from null?
| null | null | null |
63c647705f004bf4898cf3c4 | 2023-03-08T05:04:51.815Z | General Question | v1 | how to count number of spaces in a string
| null | null | null |
63c647705f004bf4898cf3c4 | 2023-03-09T17:59:17.293Z | General Question | v2 | what does getopt do? | null | null | null |
63c647705f004bf4898cf3c4 | 2023-03-10T04:39:55.998Z | General Question | v2 | what does the exec function do | null | null | null |
63c647705f004bf4898cf3c4 | 2023-03-10T18:23:27.712Z | General Question | v2 | how to use dup2
| null | null | null |
63c647705f004bf4898cf3c4 | 2023-03-14T21:29:46.419Z | General Question | v2 | how to use stat()
| null | null | null |
63c647705f004bf4898cf3c4 | 2023-04-02T22:23:25.093Z | General Question | v2 | what is asprintf and how do i use it | null | null | null |
63c647705f004bf4898cf3c4 | 2023-04-23T19:10:20.144Z | Question from Code | v2 | what is line 3 doing
| FLAGS = -Wall - g - std = gnu99 all : classifier test_load_data classifier : dectree.o classifier.o gcc ${FLAGS} - o classifier dectree.o classifier.o -
lm test_load_data : dectree.o test_load_data.o gcc ${FLAGS} - o test_load_data dectree.o test_load_data.o -
lm clas... | null | null |
63c647705f004bf4898cf3c4 | 2023-04-24T02:47:39.158Z | General Question | v2 | in a makefile, are actions called if a target has no dependencies? | null | null | null |
63c647705f004bf4898cf3c4 | 2023-04-24T16:16:33.334Z | General Question | v2 | what does wait() do?
| null | null | null |
63c647705f004bf4898cf3c4 | 2023-04-24T16:33:06.066Z | General Question | v2 | what does dup2() do?
| null | null | null |
63c647705f004bf4898cf3c4 | 2023-04-24T16:45:57.001Z | General Question | v2 | how to use pipe() | null | null | null |
63c647735f004bf4898cf3e2 | 2023-01-18T21:53:27.099Z | General Question | v1 | What value is returned by scanf when the input stream is closed?
| null | null | null |
63c647735f004bf4898cf3e2 | 2023-01-18T21:53:58.520Z | General Question | v1 | What is the EOF symbol in C? | null | null | null |
63c647745f004bf4898cf3e7 | 2023-01-27T20:03:54.977Z | Question from Code | v1 | What is wrong with this code? | #include <stdlib.h>
#include <stdio.h>
void fib(int **arr, int n) {
*arr = malloc(sizeof(int) * n);
*arr[0] = 0;
int index = 1;
if (n>=2) {
*arr[1] = 1;
index = 2;
}
while (index < n) {
*arr[index] = *arr[index - 1] + *arr[index -2];
index ++;
}
}
int mai... | null | null |
63c647745f004bf4898cf3e7 | 2023-01-27T20:05:51.724Z | Help Fix Code | v1 | null | #include <stdlib.h>
#include <stdio.h>
void fib(int **arr, int n) {
*arr = malloc(sizeof(int) * n);
*arr[0] = 0;
int index = 1;
if (n>=2) {
*arr[1] = 1;
index = 2;
}
while (index < n) {
*arr[index] = *arr[index - 1] + *arr[index -2];
index ++;
}
}
int mai... | build a dynamic array containing the first n fibonacci numbers, assuming that n is greater than or equal to 1. | null |
63c647745f004bf4898cf3e7 | 2023-01-29T02:51:54.328Z | General Question | v1 | how do i get the output of a shell command in my c program? | null | null | null |
63c647745f004bf4898cf3e7 | 2023-01-29T04:29:29.621Z | General Question | v1 | in the c programming language, how do i skip the rest of a line using scanf once I've gotten the data I wanted to use? | null | null | null |
63c647745f004bf4898cf3e7 | 2023-01-29T04:31:44.137Z | General Question | v1 | how do i skip the rest of the line using scanf if there are spaces remaining? | null | null | null |
63c647745f004bf4898cf3e7 | 2023-01-29T04:33:18.003Z | General Question | v1 | If I pipe the output of "ls -l" into a c program, how can I use scanf to get the size of each file? | null | null | null |
63c647745f004bf4898cf3e7 | 2023-01-29T04:35:59.302Z | Help Fix Code | v1 | null | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
if (!(argc == 2 || argc == 3)) {
fprintf(stderr, "USAGE: count_large size [permissions]\n");
return 1;
}
int size = strtol(argv[1], NULL, 10);
int total = 0;
int cur;
char permissions[11];
scanf("%*s ... | I am piping the following output into this code:
-rwx------ 1 reid staff 1734 Jun 22 14:52 prog
-rw------- 1 reid staff 21510 Apr 6 12:10 tmp.txt
-rwxr-xr-x 1 reid staff 8968 Feb 1 2013 xyz
it should output:
-rwx------1734
-rw------- 21510
-rwxr-xr-x 8968 | null |
63c647745f004bf4898cf3e7 | 2023-01-29T04:37:28.277Z | Question from Code | v1 | I am piping the following output into this code:
-rwx------ 1 reid staff 1734 Jun 22 14:52 prog
-rw------- 1 reid staff 21510 Apr 6 12:10 tmp.txt
-rwxr-xr-x 1 reid staff 8968 Feb 1 2013 xyz
it should output:
-rwx------1734
-rw------- 21510
-rwxr-xr-x 8968 | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
if (!(argc == 2 || argc == 3)) {
fprintf(stderr, "USAGE: count_large size [permissions]\n");
return 1;
}
int size = strtol(argv[1], NULL, 10);
//int total = 0;
int cur;
char permissions[11];
while (sc... | null | null |
63c647745f004bf4898cf3e7 | 2023-01-29T04:39:46.758Z | Help Write Code | v1 | null | null | null | I am piping the following output into this code:
-rwx------ 1 reid staff 1734 Jun 22 14:52 prog
-rw------- 1 reid staff 21510 Apr 6 12:10 tmp.txt
-rwxr-xr-x 1 reid staff 8968 Feb 1 2013 xyz
it should use scanf to output:
-rwx------1734
-rw------- 21510
-rwxr-xr-x 8968 |
63c647745f004bf4898cf3e7 | 2023-01-29T12:24:26.420Z | Question from Code | v1 | after passing sin_array into the populate_array function, how do i access the modified array? | #include <stdio.h>
#include <stdlib.h>
int populate_array(int, int *);
int check_sin(int *);
int main(int argc, char **argv) {
// TODO: Verify that command line arguments are valid.
if (argc != 2) {
return 2;
}
// TODO: Parse arguments and then call the two helpers in sin_helpers.c
// to ... | null | null |
63c647745f004bf4898cf3e7 | 2023-02-15T09:45:42.310Z | Question from Code | v1 | Why do I get a segmentation fault from this code? | int create_user(const char *name, User **user_ptr_add) {
// Check length
if (strlen(name) > MAX_NAME) {
return 2;
}
// Search for given User
if (find_user(name, *user_ptr_add) != NULL) {
return 1;
}
// Create User
User *new_user = malloc(sizeof(User));
strncpy(new_u... | null | null |
63c647745f004bf4898cf3e7 | 2023-02-15T10:24:30.234Z | General Question | v1 | If a struct contains an attribute which is an array of pointers to another struct, do I need to malloc any new elements to the array when adding them in a helper function? | null | null | null |
63c647745f004bf4898cf3e7 | 2023-02-15T12:08:49.120Z | General Question | v1 | How can I use time_t and ctime to get the current date/time as a string in the following format: "Friday Jan 27 23:01:00 2023" | null | null | null |
63c647745f004bf4898cf3e7 | 2023-02-15T14:33:07.070Z | Question from Code | v1 | Why does this code not correctly set the friend_of_deleted->friends[j] element to NULL? I want to delete the element user_to_be_deleted from the array called friend_of_deleted->friends | int delete_user(const char *name, User **user_ptr_del) {
User *user_to_be_deleted = find_user(name, *user_ptr_del);
// Check existence
if (user_to_be_deleted == NULL) {
return 1;
}
// Delete from main user list if first
if (*user_ptr_del == user_to_be_deleted) {
*user_ptr... | null | null |
63c647745f004bf4898cf3e7 | 2023-02-15T14:36:10.614Z | Question from Code | v1 | Why does this code not correctly set the friend_of_deleted->friends[j] element to NULL? I want to delete the element user_to_be_deleted from the array called friend_of_deleted->friends | int delete_user(const char *name, User **user_ptr_del) {
User *user_to_be_deleted = find_user(name, *user_ptr_del);
// Check existence
if (user_to_be_deleted == NULL) {
return 1;
}
// Delete from main user list if first
if (*user_ptr_del == user_to_be_deleted) {
*user_ptr... | null | null |
63c647745f004bf4898cf3e7 | 2023-02-15T14:43:57.679Z | Help Fix Code | v1 | null | int delete_user(const char *name, User **user_ptr_del) {
User *user_to_be_deleted = find_user(name, *user_ptr_del);
// Check existence
if (user_to_be_deleted == NULL) {
return 1;
}
// Delete from main user list if first
if (*user_ptr_del == user_to_be_deleted) {
*user_ptr... | friend_of_deleted->friends contains the element user_to_be_deleted. This element should be deleted. | null |
63c647745f004bf4898cf3e7 | 2023-02-15T15:56:40.862Z | Question from Code | v1 | Are there any memory leaks in this code? | #include "friends.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
int check_friends_length(User *checked_user);
void add_friends(User *user1, User *user2);
int check_friendship(User *user1, User *user2);
int remove_from_friends(User *unfriendee, User *unfriender);
/*
* Create a new user with the given ... | null | null |
63c647745f004bf4898cf3e7 | 2023-02-15T16:05:10.781Z | Question from Code | v1 | Are there any memory leaks or segmentation faults in this code? | #include "friends.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
int check_friends_length(User *checked_user);
void add_friends(User *user1, User *user2);
int check_friendship(User *user1, User *user2);
int remove_from_friends(User *unfriendee, User *unfriender);
/*
* Create a new user with the given ... | null | null |
63c647745f004bf4898cf3e7 | 2023-02-15T16:10:48.577Z | Question from Code | v1 | Are there any segmentation faults? WHich line is it on? | #include "friends.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
int check_friends_length(User *checked_user);
void add_friends(User *user1, User *user2);
int check_friendship(User *user1, User *user2);
int remove_from_friends(User *unfriendee, User *unfriender);
/*
* Create a new user with the given ... | null | null |
63c647745f004bf4898cf3e7 | 2023-02-15T16:12:53.120Z | Help Fix Code | v1 | null | #include "friends.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
int check_friends_length(User *checked_user);
void add_friends(User *user1, User *user2);
int check_friendship(User *user1, User *user2);
int remove_from_friends(User *unfriendee, User *unfriender);
/*
* Create a new user with the given ... | Can you fix the segmentation fault? | null |
63c647745f004bf4898cf3e7 | 2023-02-15T16:15:52.321Z | Question from Code | v1 | Where is the segmentation fault exactly? I cannot find it nor how to fix it. | #include "friends.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
int check_friends_length(User *checked_user);
void add_friends(User *user1, User *user2);
int check_friendship(User *user1, User *user2);
int remove_from_friends(User *unfriendee, User *unfriender);
/*
* Create a new user with the given ... | null | null |
63c647745f004bf4898cf3e7 | 2023-03-15T18:55:00.721Z | Help Write Code | v2 | null | null | null | allocate memory to a node and then set it's value to "hello" |
63c647745f004bf4898cf3e7 | 2023-03-15T19:24:26.940Z | Help Fix Code | v2 | parse_file should create rule_node and/or action_node from the given file fp. fp will have the following format:
main : linked_list.o main.o
gcc -Wall -g -std=gnu99 -o main linked_list.o main.o
main.o : main.c linked_list.h
gcc -Wall -g -std=gnu99 -c main.c
linked_list.o : linked_list.c linked_list.h
gcc -Wall -g... | #define MAXLINE 256
typedef struct action_node {
char **args; // An array of strings suitable to be passed to execvp
struct action_node *next_act;
} Action;
typedef struct dep_node {
struct rule_node *rule;
struct dep_node *next_dep;
} Dependency;
typedef struct rule_node {
char *target;
Dep... | null | null |
63c647745f004bf4898cf3e7 | 2023-03-15T19:59:40.354Z | Help Fix Code | v2 | count the amount of words in string | #include <stdio.h>
#include <string.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
int count_words(char *sentence) {
int count = 0;
char* token = strtok(sentence, " ");
while (token) {
token++;
token = strtok(NULL, " ");
}
return count;
}
int main() {
int n;
... | null | null |
63c647745f004bf4898cf3e7 | 2023-03-15T20:00:42.237Z | Help Fix Code | v2 | count the amount of words in string | #include <stdio.h>
#include <string.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
int count_words(char *sentence) {
int count = 0;
char* token = strtok(sentence, " ");
while (token) {
count++;
token = strtok(NULL, " ");
}
return count;
}
int main() {
int n;
... | null | null |
63c647745f004bf4898cf3e7 | 2023-03-15T20:03:33.345Z | Help Write Code | v2 | null | null | null | function to count the number of words in a string |
63c647745f004bf4898cf3e7 | 2023-03-15T20:18:56.578Z | Question from Code | v2 | why does this return a bus error | #include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int count_words(char *sentence) {
int count = 0;
char *token = strtok(sentence, " ");
while (token) {
count++;
printf("token: %s\n", token);
token = strtok(NULL, " ");
}
retur... | null | null |
63c647785f004bf4898cf400 | 2023-02-10T22:53:28.203Z | Help Fix Code | v1 | null | struct pixel **read_pixel_array(FILE *image, int pixel_array_offset, int width, int height) {
struct pixel** pixel_array = malloc(height * sizeof(struct pixel*));
struct pixel* first_pixel_row = malloc(width * sizeof(struct pixel));
for (int k = 0; k < width; k+= 3) {
struct pixel* pixie = malloc(3);
fs... | Read in pixel array by following these instructions:
1. First, allocate space for m `struct pixel *` values, where m is the height of the image. Each pointer will eventually point to one row of pixel data.
2. For each pointer you just allocated, initialize it to point to heap-allocated space for an entire row of pixel... | null |
63c647785f004bf4898cf400 | 2023-02-10T23:18:17.472Z | Help Fix Code | v1 | null | struct pixel **read_pixel_array(FILE *image, int pixel_array_offset, int width, int height) {
struct pixel** pixel_array = malloc(height * sizeof(struct pixel*));
for (int i = 0; i < height; i++) {
struct pixel* pixie_row = malloc(width * sizeof(struct pixel));
for (int j = 0; j + 3 < width; j+= 3) {
... | Each group of 3 bytes represents a single pixel, where the bytes store the blue, green, and red colour values of the pixel, in that order.
Pixels are grouped by row.
Read in pixel array by following these instructions:
1. First, allocate space for m struct pixel * values, where m is the height of the image. Each pointe... | null |
63c647785f004bf4898cf400 | 2023-02-10T23:20:18.682Z | Help Fix Code | v1 | null |
struct pixel **read_pixel_array(FILE *image, int pixel_array_offset, int width, int height) {
struct pixel** pixel_array = malloc(height * sizeof(struct pixel*));
for (int i = 0; i < height; i++) {
struct pixel* pixie_row = malloc(width * sizeof(struct pixel));
for (int j = 0; j + 4 < width; j+= 4) {
... | Each group of 3 bytes represents a single pixel, where the bytes store the blue, green, and red colour values of the pixel, in that order. Pixels are grouped by row. Read in pixel array by following these instructions: 1. First, allocate space for m struct pixel * values, where m is the height of the image. Each pointe... | null |
63c647785f004bf4898cf400 | 2023-03-10T23:22:37.737Z | Explain Code | v2 | null | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#define MAXLINE 256
#define SUCCESS "Password verified\n"
#define INVALID "Invalid password\n"
#define NO_USER "No such user\n"
int main(void) {
char user_id[MAXLINE];
char password[MAX... | null | null |
63c647785f004bf4898cf400 | 2023-03-10T23:23:50.108Z | Help Fix Code | v2 | return exit status of child | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#define MAXLINE 256
#define SUCCESS "Password verified\n"
#define INVALID "Invalid password\n"
#define NO_USER "No such user\n"
int main(void) {
char user_id[MAXLINE];
char password[MAXLINE... | null | null |
63c647795f004bf4898cf40a | 2023-02-07T19:35:03.403Z | General Question | v1 | how are pointers used with structs? | null | null | null |
63c647795f004bf4898cf40a | 2023-02-07T19:35:52.449Z | General Question | v1 | could you explain what printf does? | null | null | null |
63c647795f004bf4898cf40a | 2023-02-07T19:36:45.488Z | Explain Code | v1 | null | for (int i = 0; i < 5; i++){
printf(i);
} | null | null |
63c6477a5f004bf4898cf414 | 2023-01-30T15:59:08.737Z | General Question | v1 | can you declare two variables of the same type on one line?
| null | null | null |
63c6477a5f004bf4898cf414 | 2023-02-06T16:04:19.712Z | General Question | v1 | how do you find current time using time and ctime functions?
| null | null | null |
63c6477a5f004bf4898cf414 | 2023-02-07T14:19:25.003Z | General Question | v1 | what does fseek return? | null | null | null |
63c6477a5f004bf4898cf414 | 2023-02-12T14:25:22.391Z | General Question | v1 | how would you free nodes in a linked list? | null | null | null |
63c6477a5f004bf4898cf414 | 2023-02-20T15:47:53.422Z | General Question | v1 | How do you split a string on spaces? | null | null | null |
63c6477a5f004bf4898cf414 | 2023-02-20T19:42:42.309Z | General Question | v1 | Can you write me a function that checks whether a string has any non-space characters? | null | null | null |
63c6477a5f004bf4898cf414 | 2023-03-06T15:50:30.862Z | General Question | v1 | how do I calculate how many space separated words make up a line of a file? | null | null | null |
63c6477a5f004bf4898cf414 | 2023-03-10T01:33:37.751Z | General Question | v2 | what is the return type of stat? and how do i call it to determine the last time a file was modified? | null | null | null |
63c6477a5f004bf4898cf414 | 2023-03-14T13:28:50.295Z | General Question | v2 | how to generate a random number from 0-99 inclusive using random function? | null | null | null |
63c6477a5f004bf4898cf414 | 2023-03-14T13:32:41.204Z | Explain Code | v2 | null | for (;;) {
;
} | null | null |
63c6477a5f004bf4898cf414 | 2023-03-14T14:09:12.613Z | General Question | v2 | how to set an alarm using setitimer and ITIMER_PROF?
| null | null | null |
63c6477a5f004bf4898cf414 | 2023-03-14T14:20:56.315Z | Explain Code | v2 | null | struct itimerval new_time, old_time;
new_time.it_interval.tv_usec = 0;
new_time.it_interval.tv_sec = 5;
new_time.it_value.tv_usec = 0;
new_time.it_value.tv_sec = seconds;
setitimer(ITIMER_PROF, &new_time, &old_time); | null | null |
63c6477a5f004bf4898cf414 | 2023-03-14T14:22:55.749Z | Explain Code | v2 | null | struct itimerval new_time, old_time;
new_time.it_interval.tv_usec = 0;
new_time.it_interval.tv_sec = 0;
new_time.it_value.tv_usec = 0;
new_time.it_value.tv_sec = seconds;
setitimer(ITIMER_PROF, &new_time, &old_time); | null | null |
63c6477a5f004bf4898cf414 | 2023-03-14T14:25:49.634Z | General Question | v2 | how do you make an alarm that will send the SIGPROF signal to a program while it's executing
| null | null | null |
63c6477a5f004bf4898cf414 | 2023-03-14T14:28:09.580Z | Help Fix Code | v2 | I need this code to exit(0) when the timer sends a SIGPROF to the process
| /* The purpose of this program is to practice writing signal handling
* functions and observing the behaviour of signals.
*/
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>
/* Message to print in the signal handling function. */
#define MESSAGE "%ld reads were do... | null | null |
63c6477c5f004bf4898cf428 | 2023-01-24T20:41:32.819Z | General Question | v1 | what is char**
| null | null | null |
63c6477c5f004bf4898cf428 | 2023-01-24T20:42:08.099Z | General Question | v1 | how to dereference char**? | null | null | null |
63c6477e5f004bf4898cf432 | 2023-01-17T18:48:35.924Z | Explain Code | v1 | null | print("Hello World") | null | null |
63c6477e5f004bf4898cf432 | 2023-01-17T20:34:36.144Z | Explain Code | v1 | null | int main() {
int i = 2;
int j = 30;
int a[4];
int *p;
int *q;
p = &i;
j = *p;
*p = 1;
a[0] = 10;
a[3] = 12;
a[i] = 11;
return 0;
} | null | null |
63c6477f5f004bf4898cf441 | 2023-01-17T20:14:43.308Z | Question from Code | v1 | what will be the value of pA after execution? | int A[4] = {5, 10, 15, 20};
int *pA = A[0];
pA += 1; | null | null |
63c6477f5f004bf4898cf441 | 2023-01-17T20:16:01.166Z | Question from Code | v1 | what will be the value of pA after execution? why? | int A[4] = {5, 10, 15, 20};
int *pA = A[0];
pA += 1; | null | null |
63c6477f5f004bf4898cf441 | 2023-01-17T20:19:18.954Z | General Question | v1 | given an array of four random integers called arr, and a pointer to an integer called point, assign point to be the address of the last element in arr | null | null | null |
63c6477f5f004bf4898cf441 | 2023-01-17T20:21:20.406Z | General Question | v1 | what are strings in C? | null | null | null |
63c6477f5f004bf4898cf441 | 2023-01-17T20:22:23.255Z | General Question | v1 | give an example of a linked list in C using structs | null | null | null |
63c6477f5f004bf4898cf441 | 2023-01-17T20:25:41.876Z | Help Write Code | v1 | null | null | null | make a linked list using structs |
63c6477f5f004bf4898cf441 | 2023-01-21T05:23:59.489Z | General Question | v1 | in C, does scanf read until the newline? | null | null | null |
63c6477f5f004bf4898cf441 | 2023-01-21T06:13:37.805Z | General Question | v1 | read past the first newline of scanf | null | null | null |
63c6477f5f004bf4898cf441 | 2023-01-21T06:14:29.068Z | General Question | v1 | generate a detailed documentation of `scanf("%*c%d", &number)` with usage examples and explanations | null | null | null |
63c6477f5f004bf4898cf441 | 2023-01-21T06:42:07.726Z | General Question | v1 | skip the first line of scanf | null | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.