Podcast Beta
Questions and Answers
- Šta sadrži pokazivač inicijaliziran na varijablu tipa float?
Pokazivač može pokazivati na varijablu drugog tipa u odnosu na tip pokazivača
False
Kako se vrši inicijalizacija/postavljanje vrijednosti pokazivača p na varijablu a?
Pokazivač koji je deklarisan, ali ne i inicijaliziran:
Signup and view all the answers
Kako je moguće vršiti prosljeđivanje varijabli u funkciju?
Signup and view all the answers
Kako je moguće mijenjati vrijednost varijable lokalne za drugu funkciju?
Signup and view all the answers
Vrijednost pokazivača je uvijek adresa varijable.
Signup and view all the answers
Vrijednost inicijaliziranog pokazivača je adresa varijable na koju je inicijaliziran
Signup and view all the answers
Za dinamičko dodjeljivanje memorije u C jeziku koriste se funkcije:
Signup and view all the answers
U slučaju unaprijed nepoznate veličine niza u C jeziku poželjno je koristiti
Signup and view all the answers
Kako izgleda deklaracija malloc funkcije?
Signup and view all the answers
Funkcije za dinamičko dodjeljivanje memorije nalaze se u zaglavljua)
Signup and view all the answers
Povratni tip podatka iz malloc i realloc funkcije je prazan pokazivač.
Signup and view all the answers
Malloc i realloc funkcije vraćaju ______ pokazivač na _____________.
Signup and view all the answers
Realloc funkcija kao argument prima
Signup and view all the answers
Algoritam je
Signup and view all the answers
Kriteriji koje svaki algoritam treba zadovoljiti su
Signup and view all the answers
Algoritam je:
Signup and view all the answers
- Šta sadrži pokazivač inicijaliziran na varijablu tipa float?
Signup and view all the answers
Pokazivač može pokazivati na varijablu drugog tipa u odnosu na tip pokazivača
Signup and view all the answers
Kako se vrši inicijalizacija/postavljanje vrijednosti pokazivača p na varijablu a?
Signup and view all the answers
Pokazivač koji je deklarisan, ali ne i inicijaliziran:
Signup and view all the answers
Kako je moguće vršiti prosljeđivanje varijabli u funkciju?
Signup and view all the answers
Kako je moguće mijenjati vrijednost varijable lokalne za drugu funkciju?
Signup and view all the answers
Vrijednost pokazivača je uvijek adresa varijable.
Signup and view all the answers
Vrijednost inicijaliziranog pokazivača je adresa varijable na koju je inicijaliziran
Signup and view all the answers
Za dinamičko dodjeljivanje memorije u C jeziku koriste se funkcije:
Signup and view all the answers
U slučaju unaprijed nepoznate veličine niza u C jeziku poželjno je koristiti
Signup and view all the answers
Kako izgleda deklaracija malloc funkcije?
Signup and view all the answers
Funkcije za dinamičko dodjeljivanje memorije nalaze se u zaglavljua)
Signup and view all the answers
Povratni tip podatka iz malloc i realloc funkcije je prazan pokazivač.
Signup and view all the answers
Malloc i realloc funkcije vraćaju ______ pokazivač na _____________.
Signup and view all the answers
Realloc funkcija kao argument prima
Signup and view all the answers
Algoritam je
Signup and view all the answers
Kriteriji koje svaki algoritam treba zadovoljiti su
Signup and view all the answers
Algoritam je:
Signup and view all the answers
Study Notes
Pointers and Variables
- A pointer initialized to a variable of type float contains the memory address of that float variable.
- A pointer can point to a variable of a different type than the pointer type.
- A declared but not initialized pointer has no value.
- The value of a pointer is always an address of a variable.
- The value of an initialized pointer is the address of the variable it is initialized to.
Function Argument Passing
- It is possible to pass a variable to a function by its value or by its address.
- It is possible to change the value of a local variable in another function by passing its address.
Dynamic Memory Allocation
- In C, dynamic memory allocation is done using functions such as malloc and realloc.
- These functions are used when the size of an array is not known in advance.
- The declaration of the malloc function returns a pointer to the allocated memory.
- The return type of data from malloc and realloc functions is a void pointer.
- Malloc and realloc functions return a pointer to the allocated memory space.
- Realloc function takes the current pointer and the new size as arguments.
Algorithms
- An algorithm is a well-defined procedure that takes some input and produces a corresponding output.
- An algorithm must satisfy certain criteria, including:
- Finiteness: the algorithm must terminate after a finite number of steps.
- Definiteness: each step must be precisely defined.
- Effectiveness: the algorithm must be able to be performed with a reasonable amount of effort.
- Correctness: the algorithm must produce the correct output for any given input.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Test your knowledge of variable addressing in programming with this quiz! From understanding the difference between local and global variables to mastering pointer manipulation, this quiz will challenge your ability to navigate the complex world of variable addresses. Whether you're a seasoned coder or just starting out, this quiz is perfect for anyone looking to improve their programming skills. So, put your thinking cap on and see how well you know your way around variable addresses!