call-by-reference tag

4 questions


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[...


2 answers
139 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...


3 answers
140 views
0
cLanguage Parameters

When searching in a linked list, you search by creating a ListNode *p variable as shown below.void print_list(ListNode *head){ for(ListNode *p = head ; p != NULL ; p = p->link) printf(%d->,p-&g...


1 answers
113 views
0
Question for reference: Why do I get a compilation error if I don't use the factor as a reference form in the copy generator part?

class account{private: int accid; int balance; char *name;public: account(int id, int money, const char* a) :accid(id), balance(money) { name = new char[strlen(a) + 1]; strcpy(name, a); } account(c...

2 years ago

© 2024 OneMinuteCode. All rights reserved.