Question: C PROGRAMMING QUESTION Given this code, I know that XYZ + 1 Evaluates to 1 (True). Can you please explain how the truth value of

C PROGRAMMING QUESTION

C PROGRAMMING QUESTION Given this code, I know that "XYZ" + 1

Given this code, I know that

"XYZ" + 1  

Evaluates to 1 (True).

Can you please explain how the truth value of the comparrison between two pointers works? For example, on the left side we have s which is a pointer and then "XYZ" + 1 which is a char array in a different location. How are they being compared?

struct Node struct Node *next; int x; 1i void f(char *t, const char *s) { while ((*e++ = *s++) != 0) ; } void g(char *t, const char *s) f while (*t) t+t; f(t, s)ih int main(int argc, char **argv) struct Node node[1]; char a7] - "ABCDEF" char *p - a+ 2; char *smalloc (16) fs, a) g(s, p); // main () continues... // Evaluate the expressions in the context of main) at this point. struct Node struct Node *next; int x; 1i void f(char *t, const char *s) { while ((*e++ = *s++) != 0) ; } void g(char *t, const char *s) f while (*t) t+t; f(t, s)ih int main(int argc, char **argv) struct Node node[1]; char a7] - "ABCDEF" char *p - a+ 2; char *smalloc (16) fs, a) g(s, p); // main () continues... // Evaluate the expressions in the context of main) at this point

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!