Lorenzo Rossi
Ao
Lorenzo Rossi
C'è quarche italiano sgravato mpazzito ?
Anonymous
Dima
lol
labyrinth
Are you talking about endianness?
No, the interviewer expect other answer as I talked about endianness but i believe that what @VoidStar0x0 talked about is right, different os might have different memory alignment strategies for struct so it is better pad it with hard code.
labyrinth
I am just a fresh grad hopefully my re-interpretation on his answer is right 😅
Anonymous
Thank you rose!
labyrinth
for the COW in fork in linux, is the memory address copied in the unit of memory pages?
labyrinth
i think i found the answer, it is in the unit of page.
labyrinth
labyrinth
for a page tabled being copied, the new process shall update the page table which has correspondence to the physical memory addr right ? it did not elaborate
Sherlock
Please help me I am using binary search in c but the program is not running as expected, the function gives a segmentation fault without any reason
M__
show the code
😁😁
I need some c/c++ study material
😁😁
Anyone help
Roxifλsz 🇱🇹
Sherlock
wait
Sherlock
int binarysearch(int start,int end,int ar[],int n,int v){
int answer,mid=(start+end)/2;
printf("%d %d\n",start,end);
if(ar[mid]>v){
binarysearch(start, mid-1, ar, n, v);
}
else if (ar[mid]==v){
answer=mid;
printf("s%ds",answer);
}
else {
binarysearch(mid+1,end ,ar, n, v);
}
return answer;
}
// Complete the introTutorial function below.
int introTutorial(int V, int arr_count, int* arr) {
return binarysearch(0, arr_count-1, arr, arr_count, V);
}
Sherlock
int binarysearch(int start,int end,int ar[],int n,int v){
int answer,mid=(start+end)/2;
printf("%d %d\n",start,end);
if(ar[mid]>v){
binarysearch(start, mid-1, ar, n, v);
}
else if (ar[mid]==v){
answer=mid;
printf("s%ds",answer);
}
else {
binarysearch(mid+1,end ,ar, n, v);
}
return answer;
}
// Complete the introTutorial function below.
int introTutorial(int V, int arr_count, int* arr) {
return binarysearch(0, arr_count-1, arr, arr_count, V);
}
this is the code where the binary search function has this error somehow
😁😁
I want online study material and all stuff bro
Roxifλsz 🇱🇹
Asad
Pretty basic question here: Why, even though, I am using fflush(stdin), getchar() is not working?
Anonymous
Google it bro try to find it online first than
Ask here ....
That is how you grow....
Anonymous
I bet you can find your answer on stackoverflow...
Anonymous
Why telegram video call can't go through VPN, is it safe?
Anonymous
Seems voice call connect directly too
Anonymous
Anonymous
I thought this is relevant to c++ development and network knowledge
Roxifλsz 🇱🇹
Ибраги́м
/report
Stop misusing the report feature
Roxifλsz 🇱🇹
Ибраги́м
Ибраги́м
Link them to ask in OT
Anonymous
Roxifλsz 🇱🇹
Mustafa
/get cppbookguide
Mustafa
/get ide
Dnyaneshwar
Roxifλsz 🇱🇹
Deleted Account
Sherlock
I don't know it doesn't work
Deleted Account
Can you share the screenshot of the code written on pc
Sherlock
Wait be online
Sherlock
Sherlock
Sherlock
Deleted Account
Deleted Account
Ok lemme c that challenge
Sherlock
Sherlock
I changes the code a bit after I looked for the mid variable on google but it still gives the same output
Deleted Account
Look into discussion
Sherlock
Deleted Account
Ur code is working dude
Deleted Account
Show me the screenshot of error
Deleted Account
Because when I wrote it , it compiled
Sherlock
Sherlock
on hckrnk it compiled
Sherlock
but for any other compiler it doesn't
Sherlock
also if u submit it other cases will fail
Deleted Account
But you are using hackerrank platform na
Deleted Account
It passed all test cases
Sherlock
show the code
Sherlock
did you manually write the main function?
Deleted Account
And this code work well on other compilers too
Deleted Account
I jst pasted ur code
Sherlock
Sherlock
Deleted Account
Sherlock
that's why
Sherlock
I haven't done that
Sherlock
Should I not use the boilerplate code It sometimes has errors I have faced them before too
Sherlock
It was a major concern for me please present your views
Deleted Account