This should be very easy, but I am not sure on 2 answers of these answers, and c
ID: 3865484 • Letter: T
Question
This should be very easy, but I am not sure on 2 answers of these answers, and can anyone explain the answer?
QUESTION1 Consider a variable x. What is the correct way to access its memory address? o *X O addr(x) You cannot access it since only the operating system has such a priviledge QUESTION 2 What does it mean when a pointer is assigned a value of 0? It is a null pointer, it points to nothing It is pointing to memory address 0 It is pointing to a variable which stores 0 as its value It is pointing to a False value QUESTION3 Consider an array 'sample'. Which of the following gives the address of the first element of the array? sample sample[0] "sample QUESTION 4 When you declare a string with a length of 1 character, how many character from 'a' to 'z' can you possibly store in it? 1 2 QUESTION5 What function would you use to get the length of a string? length() size() strlength) strlenExplanation / Answer
Question 1 answer is: &x.
The unary or monadic operator & gives the ``address of a variable''.
You can access the memory address of any variable as &<variable-name>.
******************************************************************************************************
Question 2:
It is a null pointer, its points nothing.
******************************************************************************************************
Question 3:
*sample
******************************************************************************************************
Question 4: answer is 1
We can store 1 character.
C='a';
To assign, or store, a character value in a char data type is easy - a character variable is just a symbol enclosed by single quotes. For example, if c is a char variable you can store the letter A in it using the following C statement:
******************************************************************************************************
Question 5:
strlen()
char c[]={‘p’,’q’,’r’,’s’,’t’,’u’,’m’,’’};
temp=strlen(c)
temp will be equal to 7 because, null character is not counted
If any doubts feel free to reach me.
Thanks & Regards.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.