wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

AI generated Kviz o C++ strukturama

Total questions: 8

Worksheet time: 4mins

Name
Class
Date
1.

Koji se različiti tipovi podataka mogu koristiti u C++ strukturama?

a)

string, array, pointer, void, class, and enum

b)

int, float, double, char, bool, and user-defined data types

c)

int, float, char, double, long, and short

d)

true, false, null, undefined, NaN, and Infinity

2.

Kako se tipovi podataka u C++ strukturama deklariraju i koriste?

a)

By using a separate declaration statement for each variable within the structure.

b)

By specifying the data type followed by the variable name within the structure.

c)

By specifying the variable name followed by the data type within the structure.

d)

By not declaring any data types within the structure.

3.

Na primjeru objasnite koncept pokazivača na strukture u C++.

a)

A pointer to a structure in C++ is declared using the structure name followed by a plus sign (+) and the pointer variable name.

b)

A pointer to a structure in C++ is declared using the structure name followed by an asterisk (*) and the pointer variable name. For example, if we have a structure named 'Student' and we want to create a pointer to it, we can declare it as 'Student *ptr;'.

c)

In C++, a pointer to a structure is declared using the '->' operator followed by the structure name and the pointer variable name.

d)

To create a pointer to a structure in C++, we use the keyword 'struct' followed by the structure name and then the pointer variable name.

4.

Kako se može izvršiti dinamička dodjela memorije u C++ strukturama?

a)

Using the 'malloc' function

b)

Using the 'new' keyword

c)

Using the 'allocate' keyword

d)

Using the 'create' function

5.

Koje su prednosti korištenja dinamičke dodjele memorije u C++ strukturama?

a)

Dynamic memory allocation provides efficient memory usage and flexibility in managing memory during runtime.

b)

Dynamic memory allocation causes memory leaks and inefficiency

c)

Dynamic memory allocation leads to slower program execution

d)

Dynamic memory allocation makes it harder to manage memory during runtime

6.

Objasnite ulogu funkcija u C++ strukturama i kako one mogu biti korisne.

a)

Functions in C++ structures can provide a way to manipulate the data within the structure, encapsulate behavior, and make the code more organized and modular.

b)

Functions in C++ structures are not beneficial and should be avoided

c)

Functions in C++ structures make the code less organized and modular

d)

Functions in C++ structures have no impact on the data within the structure

7.

Kako se pokazivači na strukture mogu proslijediti kao argumenti funkcije u C++?

a)

Use the 'this' keyword to pass the pointer

b)

Pass the entire structure as an argument

c)

Declare the function parameter as a pointer to the structure type.

d)

Convert the structure to a string and pass it as an argument

8.

Raspravljajte o korištenju funkcija za manipuliranje podacima unutar C++ struktura.

a)

Manipulating data within C++ structures can only be done using loops and conditions

b)

Functions are not allowed to manipulate data within C++ structures

c)

Functions can be used to perform operations on the data stored within C++ structures.

d)

C++ structures cannot contain data that can be manipulated by functions