When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
16 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
After each call to survey_response_handler, you need to increment respondent_index. You also do not have 38 respondents, you only have 5, each of which has 38 responses
understood, thank you!
i will try to do that rn
@blazing rapids Has your question been resolved? If so, type !solved :)
i adjusted my read and process function to increment respondent_index. when i try and run the input it just shows a bunch of new lines.
may i see the new code?
in read and process
'''
else {
survey_response_handler(line, survey_response,respondent_index);
respondent_index++;
}
"'
in main to print it out
'''
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 10 ; j++) {
printf("%s\n", survey_response[j][i]);
}
}
'''
i put j<10 as a placeholder for now just to see what it would output
wait how do i show it appear as code im sorry ðŸ˜
try printf("%s\n", survey_response[i][j]);
fortable with learning computing concepts.
ng computing concepts.
s.
// this is the output when for the for loop
heh... here is my way to print results:
// Print all responses for all respondents
for (int i = 0; i < 5; i++) {
printf("Respondent %d responses:\n", i + 1);
for (int j = 0; j < 38; j++) {
if (survey_response[i][j][0] != '\0') { // Check if response is populated
printf(" Response %d: %s\n", j + 1, survey_response[i][j]);
}
}
printf("\n"); // Add a newline after each respondent's responses
}
!solved
Thank you and let us know if you have any more questions!
This thread is now set to auto-hide after an hour of inactivity
@blazing rapids
Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.
ok