Why it is not giving any output?
@cbcao263
hello Aryan,
ur string c is empty .
first declare string c of size n and then perform the required operation ,it will work.
Now showing Segmentation Fault.
Sir as you told, But I had declared that string as string a,b,c and then performed the operation on that.
So, It should print the result.
Sir, I have a doubt. Please tell me that as I did a-b and stored it in the integer, Will it not be an Implicit Typecasting. Compiler will do that only.
@cbcao263
arayan,
a)No typecasting will not be implicit compiler will take xor of their ascii value .
b) u are using char array so it should end with null character i.e \0 .
so first declare ur c array of size n+1 .
then after loop c[n]=’\0’;
and then print c.
or u can use c++ string.
just u need to declare ur string c as
string c(n,’ ');
and rest everthing will remain same
Sir Is It Okay now and Please see the commented part too. Please tell mistake in that.
@cbcao263
hello Aryan,
pls check ur updated code->https://ide.codingblocks.com/s/212961
here to convert char number to int i subtratced -‘0’ and then after taking their xor .
i added ‘0’ so that i become char again
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.