pointer tag

89 questions


2 answers
64 views
0
The print comes out weird after changing the value from C to pointer.

#include <stdio.h>#include <string.h>int main(void) { char pA[10] = seoul; char *pB = pA; *pB = busan; printf(%s, pB); printf(%s, pA);} After entering the code like this, the output value ...

2 years ago

1 answers
49 views
0
Compute double pointers in c

double * ptr = 0x0010; declaredIf you output ptr+1 ptr+2 ptr+3 in printf, it will be 0x00180x00200x0028.I don't understand why ptr+2 is not 0x0026 but 0x0028 in ptr+3.Is it just because it's not a pro...

2 years ago

2 answers
146 views
0
About structure pointers

struct Person { char name[20]; int age; char address[100] };int main{ { struct Person p1;struct Person *ptr;ptr = &p1; } } Even if there is no third line in int main, the variable ptr in the secon...

2 years ago

1 answers
99 views
0
C Language Pointer and Array Inquiries

Hello.I have a question about pointer and arrangement in C language.Why do I see the same number as 1 if I do p-myarr like the following code?If you calculate based on the output address value, you sh...

2 years ago

1 answers
74 views
0
While solving the problem of using double pointer variables, I had a question!!

#include<stdio.h>void MaxAndMin(int * arr,int size,int **mxptr,int **mnptr){ int * max,* min; int i; *max=*min=arr[0]; for(i=0;i<size;i++) { if(*max<arr[i]) *max=arr[i]; if(*min>arr[...


1 answers
153 views
0
I don't understand why I get double pointers with C binary tree insertion/deletion parameters

I think it's enough to receive a single pointer with the C binary tree insertion/deletion parameterIt's hard to understand why a book or a few blogs receive double pointers as parameters.The following...

2 years ago

1 answers
142 views
0
I have a question about initializing the pointer variable of the C language structure.

Hello.There are source codes from 1 to 3 as shown below.Which is the better way to initialize, number 1 or number 2?And if you initialize it as duplicate(?) like number 3, there is no error in the bui...

2 years ago

1 answers
119 views
0
I'm working on a code to input and output files on Python, but I don't know where I got it wrong crying

`python>inputfile=open(ALE.txt,r)outputfile=open(ALE2.txt,w)list1=[]for line in inputfile:Team,Won,Lost=line.split(',')Won=int(Won)Lost=int(Lost)Percentage=round((Won)/(Won+Lost),3)list1.append([Perce...

2 years ago

1 answers
76 views
0
I want to know how to declare C language 2D array + pointer array!

int arr[2][3] = { {1,2,3},{4,5,6} }; int(*parr)[3];parr = arr;I'm not sure what int (*parr)[3]; means in the above code.The arr array declared in the first line consists of two rows and three rows(*pa...

2 years ago

1 answers
70 views
0
2D Array Pointer Inquiry

int **A = { {1, 2, 3, 4} {5, 6, 7 ,8} {9,10,11,12} {13,14,15,16}};A = &A[0] Like A+2 =&A[2]Can I express an int** that refers to an address that corresponds to 11...?

2 years ago
« - 3 - »

© 2024 OneMinuteCode. All rights reserved.