can any body give me the idea to solve this problem, not the whole answer.thanks,
Use a matrix represents an island surrounded by water. Two bridges lead out of
the island. A mouse is placed on the black square. Write a program to make the
mouse take a walk across the island. The mouse is...
is converting from a char array to a single char possible ??
char data[]="163" to char data=163
and how to convert from int a=163 to char data[]="163"
and int n =163 to char a = 163
thanks
actually i am trying to calculate the expression like this
1 .first take the char in expr[]="-+*9+28*+4863 ", calculate and put it in a queue .
2. again put t items in the queue to the expr[]= "-+*910*1263".
3. and repeat 1 and 2 till q->count is 1.
now i have a doubt that my approach is...
this is the question:
One way to evaluate a prefix expression is to use a queue. To evaluate the expression, scan it repeatedly until the final expression value is known. In
each scan, read the tokens and store them in a queue. In each scan, replace an operator followed by two operands by the...
is there any possibility to convert a char to a char array
example :
here is char a ='163';
char data[16];
i want to input the value of 'a' to 'data' as
data[0]='1'
data[1]='6'
data[2]='3'
data[3]='\0'
i want to pass two characters("6","8") into a function which will convert this two chars into integers and add these two integers(6+8=14) after that it will change the value (int 14) into char (char "14") and returns the char.
can anybody help me please ??
Thank you ArkM,
I got the solution as follows
________________________________
#include <stdio.h>
#include<stdlib.h>
#include<string.h>
void newStrCpy(char* q, char* p);
int main (void)
{
char *src;
printf("\n----------------------------------------");
printf("\nPROGRAM TO COPY...
Thanks xwb , i tried by
char *temp = (char*) malloc (strlen(q) + 1);
but still the output is "null"..
in my code i checked the value of "p" before going out of the function by debugging.
at this point "p" is pointing to "temp".
But once the compiler goes out of the function p is pointing...
what is wrong with this code? its not working . can anybody explain in detail please ???
____________________________
#include <stdio.h>
#include<stdlib.h>
#include<string.h>
void newStrCpy(char* q, char* p);
int main (void)
{
char *q = "MANICHANDRA";
char *p ...
why can't we do this ??
int main()
{
char *p="MANI";;
*(p+1)='C';
*(p+2) = 'B';
*(p+3) = 'D';
printf("%s\n",p);
return 0;
}
when we can do this ..
int main()
{
char s[]="MANI";
char *p;
p=s;
*(p+1)='C';
*(p+2) = 'B';
*(p+3) = 'D'...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.