The answer should be B. There is nothing to explain (that is, the pointer variable points to the address of the variable)
2
The answer should be d, if the character array is initialized directly with a string, the length of the character array will be larger than the actual string length 1.
Because the string ends with' \0' in the character array, you can also test this with sizeof () alone.
I have tested that A is bigger than B 1.
three
The answer should be D. It goes without saying that the function of brackets is to avoid ambiguity.
four
The answer should be c, don't put int * ptr (); Confused, the topic is that a pointer function returns a plastic data, which is a
Function that returns a pointer
five
The answer is a, hehe, you will understand this when you think about it.
six
The answer is A 4
seven
The answer is 23. You should have a good look at this, especially (&; Arr+ 1) It is very different from (Arr+ 1), the former is added to the address.
1 and the latter added1* sizeof (int) to the address;
8.
Are you wrong about this question? Look carefully, there are many mistakes.
9.
The answer is B. To help you understand, I wrote a piece of code for this program.
# include & ltstdio.h & gt
void main()
{
void func(char str[ 100]);
char str[ 100];
printf("%d\n ",sizeof(str)); /The answer is 100.
func(str);
}
Voidffunc (string [100])
{
printf("%d\n ",sizeof(str)); //The answer is 4.
}
Why is this happening? The reason is that there is an essential difference between the two. The str in the first sizeof(str) is a.
Address constant, memory heap with index size of 100, and str in the second sizeof(str) is a character pointer variable.
The result of sizeof(str) is the memory of a character pointer variable, and its memory should be 4.
10
The answer is D.
Two:
1.
Wrong, it should be placed in static storage area (or global data area)
2
correct
3.
correct
4.
Wrong, it can't be floating-point type.
5.
correct
three
1.int main(void)
{
Unsigned character index = 0; //This place should be unsigned intindex = 0; Note that the first u cannot be capitalized.
while(index & lt; 256)
{
Exponent+= exponent;
index++;
}
Printf ("index value %d\n", index);
Returns 0;
}
2.
char*f()
{//should be static chars [4] = {'0',' 1',' 2',' 3',' \ 0'};
Char s[4]={' 1 ',' 2 ',' 3 ',' 0 ' }; //The beginning of the keyword cannot be capitalized, and the symbol' is incorrect.
Return to s; //ruturn's first letter cannot be capitalized either.
}
Void main()
{
char * s; //it should be char. The first letter cannot be capitalized.
s = f();
printf("%s ",s);
}
//The original intention of your question is to get the first address of a string through function call and output it in the main function.
//However, what this program doesn't take into account is that the memory occupied by that char s[4] will be automatically at the end of the called function.
//Operating system recycling, because it is only a dynamic local variable, it must be declared as a static variable to achieve the goal.
//static char s[4], another mistake is that all strings must end with' \0', otherwise the output string will not be what you want.
3.
There is nothing wrong with this question, which can achieve the expected effect, except for a few spelling mistakes, such as your first one is GetmMnory, and the second one is
Just pay attention to GetMemory.
Invalid budget (char**p)
{
* p =(char *)malloc( 100);
}
Invalid test (invalid)
{
char * str = NULL
GetMemory(& amp; str);
strcpy(str," hello morld ");
printf(str);
}
4.
There is nothing wrong with this question grammatically, except that the single quotation mark format is wrong, which violates the convention that all strings must end with' \0'.
5.
There is no grammatical error in this question, but a string function is wrongly written as strcopy, which should be written as strcpy.
Four:
I don't quite understand what your question is about, whether to build a dynamic linked list or a static linked list.
Please write the question in detail.
Five.
Int judge (int a [], int length)// This function is to judge whether it is symmetrical or not.
{
for(int I = 0; I < = length/2; i++)
If (a[i]! = a[ length -i])
Break;
If(I = = length /2+ 1)
Returns1;
other
Returns 0;
}
Invalid master (invalid)
{
int a[ 10];
int num
Printf ("Please enter the number you want to test \ n");
scanf("%d ",& ampnum);
int length = 0;
//This loop is to disassemble integers and put them into an integer array. It's just normal numbers after it's dismantled.
//reverse order, but this will not affect the result, because as long as the numbers are symmetrical after reverse order, the asymmetry after reverse order will be symmetrical.
do
{
int temp = num % 10;
A[ length] = temp;
num = num/ 10;
Length++;
} while(num & gt; = 10);
A[ length] = num;
If (judging (a, length))
printf(" Yes \ n ");
}
If you don't understand anything about this program, you can ask it at any time to help you analyze it.
I hope my answer will help you a little. ...