find the bugs

D

Default User

Richard said:
Default User said:

Only for those who subscribe to clc++ (or, of course, for those who
trust the claims of those who do). And, naturally, I trust your claim.


I was certain that you would find that information to be of use.




Brian
 
O

Old Wolf

<context restored after being snipped by Christopher
int main(int argc, char *argv[]) {
const char *name = NULL, *c = NULL;
if (argc >= 2)
c = argv[1];
name = getName(c);
printf("My name is %s\n", name);
return 0;
}
MY SOLUTION : #bug 1: name==NULL is illegal
How so? You're comparing a pointer to NULL which is perfectly legal.
name is not a pointer.

Yes, it is.

The "name==NULL" code occurred inside the getName() function,
where the pointer 'name' is not visible.
 
R

Richard Heathfield

Old Wolf said:
The "name==NULL" code occurred inside the getName() function,
where the pointer 'name' is not visible.

BION, IR = (in the OP) as ==, and from that misreading I proceeded
directly to the scene of the misunderstanding. Mea culpa.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,831
Latest member
HealthSmartketoReviews

Latest Threads

Top