pointer tag

89 questions


1 answers
48 views
0
I have a question about the pointer operation.

In a 32-bit architecture, how does this code output?#include <stdio.h>int main(void) { int x[4]; printf(%p\n, (void*) (x)); printf(%p\n, (void*) (x + 1)); printf(%p\n, (void*) (&x)); printf(...

2 years ago

1 answers
113 views
0
Why do you put an asterisk before the name, not after the type, when declaring the C pointer?

Why do you put an asterisk before the name, not after the type, when declaring the C pointer?It's usually declaredint* myVariable; instead of int *myVariable;Why do you put an asterisk in front of you...


1 answers
43 views
0
When do you use * and & together?

I'm learning pointers for the first time, but I'm still confusedI know that & refers to the address of the variable and * is attached to the variable to be used as a pointerI don't know how to wri...

2 years ago

1 answers
45 views
0
Why isn't there a pointer in Python?

I have a question while studying the language pointerAny language is basically in memory We have no choice but to use variables and addressesIs it because Python doesn't need an address?Or is it becau...

2 years ago

1 answers
107 views
0
C Pointer vs Java Reference Variables vs Other Languages Comparison

Hi, how are you?I am a student who forgot all the C and C++ I learned at school in the military and is currently studying Java and C# as an intern part-time job and hobby.Currently, I am taking an int...


1 answers
49 views
0
C++ array and pointer *This is a question related to arithmetic

#include <stdio.h>#include <conio.h>int main(){ int a[3][5] = { {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15} }; printf(%d, (a + 1)); printf(\n%d, *(a + 1)); _getch();}The res...


1 answers
48 views
0
Pointer. Very basic question...

#include <stdio.h>int main(){ int a = 10; int *pa = &a; *pa = 20; printf(%d, a); return 0;}In this code, the 10 assigned to the memory digit of a is changed to 20 Is it right to change it to...

2 years ago

1 answers
46 views
0
I wonder about the memory area of the pointer!

void swap(int *a, int *b){ int temp=*a; *a=*b; *b=temp;}As an example of call by reference in this way, we use pointers in frequently used functions.While studying the memory area, I found out that t...

2 years ago

2 answers
140 views
0
While solving the problem using the array pointer, I had a question

#include<stdio.h>void rotate(int(*ptr)[4]){ int i,j; int temp[4][4]; for(i=0;i<4;i++) { for(j=0;j<4;j++) { temp[i][j]=ptr[3-j][i]; } } for(i=0;i<4;i++) { for(j=0;j<4;j++) { pt...


1 answers
137 views
0
I want to know how to declare a pointer

Can anyone explain how the following three methods of declaring a pointer are different?

« - 6 - »

© 2024 OneMinuteCode. All rights reserved.