New Posts  All Forums:Forum Nav:

Need some C++ help

post #1 of 6
Thread Starter 
I am working on my final project (1st Semester), i am making database of medical store.
I am getting error which i've never seen before. I also did some googling but couldn't find some satisfactory answer.
I am getting around 25 errors and all of them say that the variables i initialized in structure are not a part of fstream. I am using Borland 5.02 compiler.
Any kind of help will be highly appreciated.

You can click the following link to see the source code (cpp file):
http://www.mediafire.com/?nfyf8c8oqx6rv79
Red Devil
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 870 Asus ROG Maximus III Formula Many Many 
Hard DriveOptical DriveOSMonitor
Many SSDs and HDDs None Windows 7 Ultimate Dell ST2310 
PowerCase
Xigmatek NRP-MC 1000w HSPC Tech Station 
  hide details  
Reply
Red Devil
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 870 Asus ROG Maximus III Formula Many Many 
Hard DriveOptical DriveOSMonitor
Many SSDs and HDDs None Windows 7 Ultimate Dell ST2310 
PowerCase
Xigmatek NRP-MC 1000w HSPC Tech Station 
  hide details  
Reply
post #2 of 6
Please post the errors you're getting.

Also, you should clean up the code a bit, it's very hard to read, the entire program exists within int main(). You have a while (1) loop, and within that is a gigantic switch statement with huge amounts of code in each case. Each of those cases should probably be it's own function, and the switch itself should likely be called from it's own function as well.

Code:
// Give these a better name
void Case1Function()
{

}

// Give these a better name
void Case2Function()
{

}

void HandleInput()
{
    switch ( value )
    {
        case 1:
            Case1Function();
            break;
        case 2:
            Case2Function();
            break;
        default:
            break;
    } 
}

int main()
{
    // Gather input

    // Pass input into this function
    HandleInput();
}

Edited by lordikon - 6/16/11 at 12:11pm
Foldatron
(17 items)
 
Mat
(10 items)
 
Work iMac
(9 items)
 
CPUMotherboardGraphicsGraphics
i7 950 EVGA x58 3-way SLI EVGA GTX 660ti GTX 275 
RAMHard DriveHard DriveHard Drive
3x2GB Corsair Dominator DDR3-1600 80GB Intel X25-M SSD 2TB WD Black 150GB WD Raptor 
Hard DriveOSMonitorKeyboard
2x 150GB WD V-raptor in RAID0 Win7 Home 64-bit OEM 55" LED 120hz 1080p Vizio MS Natural Ergonomic Keyboard 4000 
PowerCase
750W PC P&C Silencer CoolerMaster 690 
CPUGraphicsRAMHard Drive
Intel Core i5 2500S AMD 6770M 8GB (2x4GB) at 1333Mhz 1TB, 7200 rpm 
Optical DriveOSMonitorKeyboard
LG 8X Dual-Layer "SuperDrive" OS X Lion 27" iMac screen Mac wireless keyboard 
Mouse
Mac wireless mouse 
CPUGraphicsRAMHard Drive
i7-2600K AMD 6970M 1GB 16GB PC3-10600 DDR3 1TB 7200rpm 
Hard DriveOptical DriveOSMonitor
256GB SSD 8x DL "SuperDrive" OS X 10.7 Lion 27" 2560x1440 iMac display 
Monitor
27" Apple thunderbolt display 
  hide details  
Reply
Foldatron
(17 items)
 
Mat
(10 items)
 
Work iMac
(9 items)
 
CPUMotherboardGraphicsGraphics
i7 950 EVGA x58 3-way SLI EVGA GTX 660ti GTX 275 
RAMHard DriveHard DriveHard Drive
3x2GB Corsair Dominator DDR3-1600 80GB Intel X25-M SSD 2TB WD Black 150GB WD Raptor 
Hard DriveOSMonitorKeyboard
2x 150GB WD V-raptor in RAID0 Win7 Home 64-bit OEM 55" LED 120hz 1080p Vizio MS Natural Ergonomic Keyboard 4000 
PowerCase
750W PC P&C Silencer CoolerMaster 690 
CPUGraphicsRAMHard Drive
Intel Core i5 2500S AMD 6770M 8GB (2x4GB) at 1333Mhz 1TB, 7200 rpm 
Optical DriveOSMonitorKeyboard
LG 8X Dual-Layer "SuperDrive" OS X Lion 27" iMac screen Mac wireless keyboard 
Mouse
Mac wireless mouse 
CPUGraphicsRAMHard Drive
i7-2600K AMD 6970M 1GB 16GB PC3-10600 DDR3 1TB 7200rpm 
Hard DriveOptical DriveOSMonitor
256GB SSD 8x DL "SuperDrive" OS X 10.7 Lion 27" 2560x1440 iMac display 
Monitor
27" Apple thunderbolt display 
  hide details  
Reply
post #3 of 6
Thread Starter 
Ok guys need some more help. Used functions in my program to make it a bit more simple to understand.
Here is the source file:
http://www.mediafire.com/?n3z2pl9aqcy8y8h

Getting some very ajeeb ajeed errors. I made a total of 9 functions and compiler is giving error for 6 of them and error is:
Unresolved external 'function name()' referenced from H:\\"program name.obj"

Its some error related to Object file.
Red Devil
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 870 Asus ROG Maximus III Formula Many Many 
Hard DriveOptical DriveOSMonitor
Many SSDs and HDDs None Windows 7 Ultimate Dell ST2310 
PowerCase
Xigmatek NRP-MC 1000w HSPC Tech Station 
  hide details  
Reply
Red Devil
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 870 Asus ROG Maximus III Formula Many Many 
Hard DriveOptical DriveOSMonitor
Many SSDs and HDDs None Windows 7 Ultimate Dell ST2310 
PowerCase
Xigmatek NRP-MC 1000w HSPC Tech Station 
  hide details  
Reply
post #4 of 6
Any reason you don't feel like posting it here? I'm not going to go to an external site, wait X seconds for the download to begin, spend X seconds downloading, copy & pasting the code into an IDE editor, and then examining it for you.

Please paste the code here, regardless of how much there is.
Primary PC
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II 720 (2.8 ghz) BIOSTAR A780L3L (AM3) MSI GeForce 9800GT G.Skill Ripjaws Series DDR3 1600 (8GB) 
Hard DriveOSMonitorPower
Crucial M4 64GB / Samsung F3 1TB Windows 7 Pro (64-bit) Dell SP2309W (2048x1152) PC Power & Cooling 610W 
CaseMouse
Cooler Master Elite 430 RC Logitech MX518 
  hide details  
Reply
Primary PC
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II 720 (2.8 ghz) BIOSTAR A780L3L (AM3) MSI GeForce 9800GT G.Skill Ripjaws Series DDR3 1600 (8GB) 
Hard DriveOSMonitorPower
Crucial M4 64GB / Samsung F3 1TB Windows 7 Pro (64-bit) Dell SP2309W (2048x1152) PC Power & Cooling 610W 
CaseMouse
Cooler Master Elite 430 RC Logitech MX518 
  hide details  
Reply
post #5 of 6
I also will not go through that but,
Quote:
Originally Posted by iPoop View Post
Any reason you don't feel like posting it here? I'm not going to go to an external site, wait X seconds for the download to begin, spend X seconds downloading, copy & pasting the code into an IDE editor, and then examining it for you.

Please paste the code here, regardless of how much there is.
no.
OP, please use one of these:
http://pastesite.com
http://paste.org/
http://www.pastie.org/
http://pastecode.com/
http://pastebin.com/
15s
(13 items)
 
  
CPUMotherboardGraphicsRAM
Athlon II x4 640 Gigabyte 880GM-D2H AMD HD4250 4 GB 
Hard DriveOSMonitorPower
640GB Arch GNU/Linux i686 Fujitsu Siemens 4612 FA 350 W 
Mouse
Logitech G9x 
  hide details  
Reply
15s
(13 items)
 
  
CPUMotherboardGraphicsRAM
Athlon II x4 640 Gigabyte 880GM-D2H AMD HD4250 4 GB 
Hard DriveOSMonitorPower
640GB Arch GNU/Linux i686 Fujitsu Siemens 4612 FA 350 W 
Mouse
Logitech G9x 
  hide details  
Reply
post #6 of 6
I had some time to waste, I love coding, plus I felt a little like Spiderman, so I decided to help you :-) .

I made a few adjustments to your code and it worked flowlessly for me. Some things to notice:

1. I would suggest you to upgrade to a newer version than 5.. that would save you a lot of time and effort. Check Codegear 2007 and newer up to XE.
2. I think you should make clear declarations in your functions like :
type function_name(parameters); -> void function1(void); -> instead of : function1();
This will cause warnings to appear.. ("Function should return a value" etc..).
3. Once you declare your function like step 2 be careful not to do it again when you implement your code. There were a few times you did in your code.
void function1(void);

void function1(void)
{
command1;
command2;
}
4. In your switch command make sure you include a "default" case.. just in case..
5. Keep an order with your { } - in order not to lose track. (Check your code now.. :-p )

here is your code : http://pastesite.com/24255
My Ride
(15 items)
 
  
CPUMotherboardGraphicsRAM
965 @ 4.5GHz , 4.363GHz Benchmark Stable ASUS M5A97 R2.0 HD7850-DC2-2GD5 G.SKILL F3-12800CL9D-8GBXL 8GB (2X4GB) DDR3 PC3... 
Hard DriveHard DriveCoolingOS
Seagate+WD Disks KINGSTON SSD Now 120GB V300 Xigmatek HDT-S963 Windows 7 x64 Ultimate 
MonitorKeyboardPowerCase
LG-2452V + LG-E2260 Logitech Classic Keyboard 200 Corsair TX650 V2 — 80 PLUS® Bronze Certified 65... Thermaltake Soprano Black 
MouseMouse PadAudio
Wireless Optical COM20(B168) Black Gel.. Creative X-Fi Xtreme Gamer Fata1ity Pro 
  hide details  
Reply
My Ride
(15 items)
 
  
CPUMotherboardGraphicsRAM
965 @ 4.5GHz , 4.363GHz Benchmark Stable ASUS M5A97 R2.0 HD7850-DC2-2GD5 G.SKILL F3-12800CL9D-8GBXL 8GB (2X4GB) DDR3 PC3... 
Hard DriveHard DriveCoolingOS
Seagate+WD Disks KINGSTON SSD Now 120GB V300 Xigmatek HDT-S963 Windows 7 x64 Ultimate 
MonitorKeyboardPowerCase
LG-2452V + LG-E2260 Logitech Classic Keyboard 200 Corsair TX650 V2 — 80 PLUS® Bronze Certified 65... Thermaltake Soprano Black 
MouseMouse PadAudio
Wireless Optical COM20(B168) Black Gel.. Creative X-Fi Xtreme Gamer Fata1ity Pro 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming