Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 18th, 2005, 5:04 AM   #11
hipolito
Programmer
 
Join Date: Feb 2005
Posts: 41
Rep Power: 0 hipolito is on a distinguished road
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)...
hipolito is offline   Reply With Quote
Old Feb 18th, 2005, 7:30 AM   #12
Benoit
Expert Programmer
 
Benoit's Avatar
 
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 574
Rep Power: 5 Benoit is on a distinguished road
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
Benoit is offline   Reply With Quote
Old Feb 18th, 2005, 8:37 AM   #13
hipolito
Programmer
 
Join Date: Feb 2005
Posts: 41
Rep Power: 0 hipolito is on a distinguished road
Ok, I noticed, but still whem I use the &, the IF clause always go to else...... beeing a number ot letter...
hipolito is offline   Reply With Quote
Old Feb 18th, 2005, 9:36 AM   #14
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Old Feb 18th, 2005, 9:45 AM   #15
hipolito
Programmer
 
Join Date: Feb 2005
Posts: 41
Rep Power: 0 hipolito is on a distinguished road
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...
hipolito is offline   Reply With Quote
Old Feb 18th, 2005, 10:40 AM   #16
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:11 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC