New Posts  All Forums:Forum Nav:

C++ Help - Page 2

post #11 of 14
What is the purpose of this? scanf_s("%d",f)
Hex
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom 1100T ASUS M4A89TD GTX 470 G.SKILL Ripjaws Series (2 x 2GB) DDR3 1600 
Hard DriveOptical DriveOSMonitor
WD 500GB + WD 1TB LG DVD RW Windows 7 Pro Viewsonic 24" 
KeyboardPowerCaseMouse
Microsoft X6 Cooler Master 750W Antec 300 CM Storm Sentinel 
  hide details  
Reply
Hex
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom 1100T ASUS M4A89TD GTX 470 G.SKILL Ripjaws Series (2 x 2GB) DDR3 1600 
Hard DriveOptical DriveOSMonitor
WD 500GB + WD 1TB LG DVD RW Windows 7 Pro Viewsonic 24" 
KeyboardPowerCaseMouse
Microsoft X6 Cooler Master 750W Antec 300 CM Storm Sentinel 
  hide details  
Reply
post #12 of 14
Quote:
Originally Posted by ZionEx View Post
What is the purpose of this? scanf_s("%d",f)
And shouldn't it be &f, to store %d (the input) as an integer of variable f?
    
CPUMotherboardGraphicsRAM
Athlon 64 3800+ @2.785GHz Shuttle 7950GT 2GB OCZ 
Hard DriveOptical DriveOSMonitor
320GB Seagate in Ext. Case SATA DVD-RW w/ Lightscribe Censored to avoid flaming HP M70 
PowerCaseMouse
250W Shuttle "Elanpower" Shuttle Glamour xPC Logitech MX518 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Athlon 64 3800+ @2.785GHz Shuttle 7950GT 2GB OCZ 
Hard DriveOptical DriveOSMonitor
320GB Seagate in Ext. Case SATA DVD-RW w/ Lightscribe Censored to avoid flaming HP M70 
PowerCaseMouse
250W Shuttle "Elanpower" Shuttle Glamour xPC Logitech MX518 
  hide details  
Reply
post #13 of 14
Thread Starter 
never mind got it fixed
    
CPUMotherboardGraphicsRAM
Intel Q6600 B3 2.4Ghz Asus P5N-E SLI eVGA 8600GT 256MB OCZ Reaper HPC PC2-6400 (4 x 1GB) 
Hard DriveOSPowerCase
Western Digital 500GB Windows Vista Ultimate 64-Bit Thermaltake Toughpower 700W (60A) Cooler Master 690 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Intel Q6600 B3 2.4Ghz Asus P5N-E SLI eVGA 8600GT 256MB OCZ Reaper HPC PC2-6400 (4 x 1GB) 
Hard DriveOSPowerCase
Western Digital 500GB Windows Vista Ultimate 64-Bit Thermaltake Toughpower 700W (60A) Cooler Master 690 
  hide details  
Reply
post #14 of 14
Quote:
Originally Posted by The Hundred Gunner View Post
And shouldn't it be &f, to store %d (the input) as an integer of variable f?
If stores into the address indicated by the second parameter. This is c++, remember, so when you give a function the int f, you give it the value held in f. In this case, that value has been initialized to 0, so it tries to store the result in the address 0x00000000. That is protected memory, so he gets the error shown.

**edit**
nm - I thought you typed "it shouldn't be &f"
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming