![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Programmer
Join Date: Feb 2005
Posts: 41
Rep Power: 0
![]() |
what I have just tryed is NOT using the & on scanf("%d", value); Thats when I type a number the program crashes (segmentation fault - core dumped)...
|
|
|
|
|
|
#12 |
|
Expert Programmer
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 574
Rep Power: 5
![]() |
You need the & when using scanf because thats how it knows the address of the variable
![]()
__________________
Johnny was a chemist's son but Johnny is no more, for what Johnny thought was H2O was H2SO4 |
|
|
|
|
|
#13 |
|
Programmer
Join Date: Feb 2005
Posts: 41
Rep Power: 0
![]() |
Ok, I noticed, but still whem I use the &, the IF clause always go to else...... beeing a number ot letter...
|
|
|
|
|
|
#14 |
|
Programming Guru
![]() ![]() ![]() |
The code i have above works fine for me. A number when its a number and a letter when its a letter. If you can't use this... then post your entire code so we can see where it may be failing for you.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#15 |
|
Programmer
Join Date: Feb 2005
Posts: 41
Rep Power: 0
![]() |
Yes, It is done, thank you very much, I was using the atoi(value) , and that does NOT works.
once again THX for your time... |
|
|
|
|
|
#16 |
|
Programming Guru
![]() ![]() ![]() |
glad we could help
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|