imm getting segmentation fault…can u tell me where am i going wrong??
in this code im finding out indices of an which is equalt to m
eg
1 2 3 4 4
key =4
ans = [3 4]
imm getting segmentation fault…can u tell me where am i going wrong??
in this code im finding out indices of an which is equalt to m
eg
1 2 3 4 4
key =4
ans = [3 4]
hello @apoorv.chauhann
i think u forgot to save the code.
so pls save ur code and share the link again.
pass j by reference
check now->
thank you…can you explain me …how passing j as a refrence is a solution?? like i didnt get the reason why without refrence my code was giving segmentation fault
value of j was not getting retained because u were passing as value , to make changes visible in original variable j we need to pass it as reference.
also while printing output u were running loop till <= but actually u need to run till <
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.