i cant find anything wrong with the if statements?
i cant find anything wrong with the if statements?
yeah, it is fine, except it cant print out the actual receipt which is what the program was intended to do. i cant seem to work out how to do it either
Hey, just noticed - what's this supposed to do?
It somehow doesn't look right to me... I could be wrong though.Code:if(product1 > "z") {...}
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.
that if statement just means that if someone has written more than just "z" for the product details, that it should display those details, otherwise leave it blank. its basically a test, im not sure if its the best way of doing it though. if u can help me with it, i would really appreciate it.
Somebody correct me if I'm wrong, but this is what I'm thinking it will do:
take the value of the pointer called product1
compare it to
the value of a pointer to a static array of 1 character, which is "z"
So basically, it's not really comparing the strings, but the pointers (which are sort of like integers, unless I'm wrong which is very likely). Try something like this:
That might work better, I haven't tried it though.Code:char product[20] = {0}; // or = ""; (I'm not sure) (...) if(product[0] != '\0') {...}
Last edited by Hunter2; 11-23-2002 at 03:33 PM.
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.
that too
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.
thanks a lot for that help salem, but when u press "0" to stop typing in products it doesnt display the receipt it just exits
do u know how to fix this?
excuse my dumbness but im not sure where to insert the pause code in the program
Right after the receipt is printed out. Because right after that the program quits; if you pause between that and the quit, it will display then quit after the pause. Otherwise, if you put it earlier, it will pause then display it too fast for you to see and then quit.
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.
wow that works beautifully, thanks alot salem and hunter2
ill be sure to come to u if i have any more problems
No problem
face_master: Any day!
heh
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.
lol, forgot bout this thread I spend too much time in the General Forum!