
CS 341 Lab 1 Spring 2024

Flashcard
•
Computers
•
University
•
Hard
Wayground Content
FREE Resource
Student preview

7 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Which of the following does not depend on the architecture of the computer? Options: sizeof(char*), sizeof(char), sizeof(int), sizeof(int*)
Back
sizeof(char)
2.
FLASHCARD QUESTION
Front
Which of the following is a system call? printf, fprintf, write, scanf
Back
write
3.
FLASHCARD QUESTION
Front
Which of the following is NOT true about malloc?
The memory allocated by malloc is not initialized.
Malloc will always allocate a block of memory.
Malloc may return NULL if the requested block size is 0.
The pointer returned by malloc is of type void*.
Back
Malloc will always allocate a block of memory.
4.
FLASHCARD QUESTION
Front
How do you allocate sufficient space on the heap to copy an existing string pointed to by a char pointer char* src? Options: malloc(sizeof(src) + 1), malloc(sizeof(src)), malloc(strlen(src) + 1), malloc(strlen(src))
Back
malloc(strlen(src) + 1)
5.
FLASHCARD QUESTION
Front
What is the output of the following code snippet? (Assume that an int is 4 bytes)
char* ptr = "123456789\0";
int *int_ptr = (int*)ptr;
printf("%s", int_ptr + 1);
Back
56789
6.
FLASHCARD QUESTION
Front
What are the data types of ptr1 and ptr2 if the above line is executed? int* ptr1, ptr2;
Back
int*, int
7.
FLASHCARD QUESTION
Front
What is the value of y in the following code?
int x;
int y = x + 2;
Back
Undefined
Similar Resources on Wayground
11 questions
CE-LP2 Noções de Linguagens Procedurais

Flashcard
•
KG - University
10 questions
Arrays

Flashcard
•
10th - 12th Grade
7 questions
Flashcard on Accumulators and Sentinel Values

Flashcard
•
12th Grade
4 questions
flashcard - Papo formativo_Pensamento computacional_EM_R7

Flashcard
•
KG - University
11 questions
Computer Programming

Flashcard
•
University
11 questions
Java String Objects & Methods

Flashcard
•
12th Grade
5 questions
Arrays

Flashcard
•
11th Grade
4 questions
If conditional statement

Flashcard
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University