Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 118,923 C++ Programmers for FREE! Ask your question and get quick answers from experts. There are 1,948 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



can someone debbud my C++ project? ;(

 
Reply to this topicStart new topic

can someone debbud my C++ project? ;(

servant2559
post 18 Jul, 2008 - 12:28 AM
Post #1


New D.I.C Head

*
Joined: 18 Jul, 2008
Posts: 1

cpp

#include<stdio.h>
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<graphics.h>
#include<ctype.h>
#define MAX 100
struct info{
char name[10];
char car[10];
char plate[10];

}
record [MAX];
counter [MAX];
void box(int startx, int starty, int endx, int endy, int color);
void main()
{

FILE *fp;
main:
int count;
int driver,mode;
driver=VGA;
mode=VGAMED;
initgraph(&driver,&mode,"");
gotoxy(25,1);
char a,b,l;
box(100,20,500,200,70);
setcolor(GREEN);
outtextxy(150,30,"AUTOMOBILE REGISTRATION");
outtextxy(150,50,"Type R for registration of your car");
outtextxy(150,70,"Type S to search the list of listed cars");
outtextxy(150,90,"Type E to Exit");
outtextxy(150,110,"Select R/S/E: ");
a=getche();
clrscr();
switch (toupper(a))
{
case 'R':
count=0;
reg:
clrscr();
int drive,mod;
drive=VGA;
mod=VGAMED;
initgraph(&drive,&mod,"");
box(100,20,500,200,70);
setcolor(BLUE);
fp=fopen("record.dat","a+");
{
if((fp=fopen("record.dat","w"))!=NULL);
{
if((fp=fopen("counter.dat","w"))!=NULL);
}
}

count=count+1;
outtextxy(150,30,"Registration no: ");
gotoxy(45,3);
printf("%d",count);
outtextxy(150,60,"Name of the owner: ");
gotoxy(45,5);
gets(record[count].name);
outtextxy(150,70,"Name of the car: ");
gotoxy(45,6);
gets(record[count].car);
outtextxy(150,80,"Plate number: ");
gotoxy(45,7);
gets(record[count].plate);
fwrite(&record,sizeof(struct info),MAX,fp);
fclose(fp);
clrscr();
int drivey,mody;
drivey=VGA;
mody=VGAMED;
initgraph(&drivey,&mody,"");
box(100,20,500,100,70);
setcolor(GREEN);
outtextxy(150,50,"Register again? Y/N");
b=getche();
switch (toupper(cool.gif)
{
case 'Y':
goto reg;

case 'N':
goto main;

default:
goto main;
}


case 'S':
search:
int drivec,modc;
drivec=VGA;
modc=VGAMED;
initgraph(&drivec,&modc,"");
box(100,20,500,200,40);
setcolor(WHITE);
outtextxy(150,50,"Search mode");
outtextxy(150,70,"Owners name?:");
char searchname [20];
int found = 0;
int lola;
gotoxy(40,6);
scanf("%s", &searchname);

if( strcmp(searchname,record[count].name) == 0){
{

outtextxy(150,90,"\nOwner:");
outtextxy(300,90,record[count].name);
outtextxy(150,100,"\nCar:");
outtextxy(300,100,record[count].car);
outtextxy(150,110,"\nPlate No.:");
outtextxy(300,110,record[count].plate);
getch();
}
found = 1;
clrscr();
int delqx,mqelqx;
delqx=VGA;
mqelqx=VGAMED;
initgraph(&delqx,&mqelqx,"");
box(100,20,500,200,90);
outtextxy(150,50,"Goto 1. search again? / 2. mainmenu");
lola=getche();
switch (toupper(lola))
{
case '1':
goto search;

case '2':
goto main;

default:
int delq,mqelq;
delq=VGA;
mqelq=VGAMED;
initgraph(&delq,&mqelq,"");
box(100,20,500,200,RED);
outtextxy(150,50,"INVALID SELECTION!!");
getch();
goto main;
}

} else { found = 0; }

if(found==0){
clrscr();
math:

int da,mqa,lolo;
da=VGA;
mqa=VGAMED;
initgraph(&da,&mqa,"");
box(100,20,500,200,30);
outtextxy(150,50,"No match found!!");
outtextxy(150,70,"Goto 1. search / 2. mainmenu");
lolo=getche();
switch (toupper(lolo))
{
case '1':
goto search;

case '2':
goto main;

default:
int del,mqel;
del=VGA;
mqel=VGAMED;
initgraph(&del,&mqel,"");
box(100,20,500,200,RED);
outtextxy(150,50,"INVALID SELECTION!!");
getch();
goto math;
}
}

break;


case 'E':
int d,mq;
d=VGA;
mq=VGAMED;
initgraph(&d,&mq,"");
box(100,20,500,200,40);
outtextxy(150,50,"Are you sure? Y/N");
b=getche();

switch (toupper(cool.gif)
{
case 'Y':
break;

case 'N':
goto main;

default:
clrscr();
int db,mqb;
db=VGA;
mqb=VGAMED;
initgraph(&db,&mqb,"");
box(100,20,500,200,RED);
outtextxy(150,50,"INVALID SELECTION!!");
getch();
goto main;
}
break;

default:
int de,mqe;
de=VGA;
mqe=VGAMED;
initgraph(&de,&mqe,"");
box(100,20,500,200,RED);
outtextxy(150,50,"INVALID SELECTION!!");
getch();
goto main;
}

getch();




}
void box(int startx, int starty, int endx, int endy, int color)
{
setcolor(color);
line(startx,starty,startx,endy);
line(startx,starty,endx,starty);
line(endx,starty,endx,endy);
line(endx,endy,startx,endy);
}


** Edit ** code.gif
User is offlineProfile CardPM

Go to the top of the page


MorphiusFaydal
post 18 Jul, 2008 - 01:49 AM
Post #2


D.I.C Lover

Group Icon
Joined: 12 May, 2005
Posts: 1,054



Thanked 7 times

Expert In: Hardware, Networking

My Contributions


How about you tell us what's wrong with it, then we'll see if we can help. Give us a list of errors from the compiler.. Or tell us what it's *supposed* to do versus what it *is* doing. And what compiler.

Actually, we don't need to know that. I can tell it's Borland Turbo C++ 3... Why do people still use that ancient POS? There's dozens of compilers and IDE's that are much more recent with updated headers and a much better interface...
User is offlineProfile CardPM

Go to the top of the page

markhazlett9
post 18 Jul, 2008 - 09:03 AM
Post #3


D.I.C Head

**
Joined: 12 Jul, 2008
Posts: 56



Thanked 3 times
My Contributions


QUOTE(MorphiusFaydal @ 18 Jul, 2008 - 01:49 AM) *

There's dozens of compilers and IDE's that are much more recent with updated headers and a much better interface...


which one would you recommend... i'm using borland turbo c++ too just because it came with the book i'm working on. which one would you suggest?
User is offlineProfile CardPM

Go to the top of the page

gabehabe
post 18 Jul, 2008 - 09:07 AM
Post #4


T3H R0XX0R!

Group Icon
Joined: 6 Feb, 2008
Posts: 3,608



Thanked 73 times

Dream Kudos: 2400

Expert In: (X)HTML, CSS, Batch Scripting, C, C++

My Contributions


Code::Blocks is my favourite smile.gif

Note,
Borland is the only compiler with a library called "graphics"

You will need to copy it from your Borland compiler directory into your new compiler directory.
User is online!Profile CardPM

Go to the top of the page

markhazlett9
post 18 Jul, 2008 - 09:59 AM
Post #5


D.I.C Head

**
Joined: 12 Jul, 2008
Posts: 56



Thanked 3 times
My Contributions


QUOTE(gabehabe @ 18 Jul, 2008 - 09:07 AM) *


You will need to copy it from your Borland compiler directory into your new compiler directory.


- Where specifically in the program files is it?
User is offlineProfile CardPM

Go to the top of the page

gabehabe
post 18 Jul, 2008 - 10:19 AM
Post #6


T3H R0XX0R!

Group Icon
Joined: 6 Feb, 2008
Posts: 3,608



Thanked 73 times

Dream Kudos: 2400

Expert In: (X)HTML, CSS, Batch Scripting, C, C++

My Contributions


No idea.

Try doing a file search for graphics.h on your computer. smile.gif
User is online!Profile CardPM

Go to the top of the page

markhazlett9
post 18 Jul, 2008 - 10:24 AM
Post #7


D.I.C Head

**
Joined: 12 Jul, 2008
Posts: 56



Thanked 3 times
My Contributions


QUOTE(gabehabe @ 18 Jul, 2008 - 10:19 AM) *

No idea.

Try doing a file search for graphics.h on your computer. smile.gif


will do thanks
User is offlineProfile CardPM

Go to the top of the page

born2c0de
post 18 Jul, 2008 - 11:38 PM
Post #8


printf("I'm a %XR",195936478);

Group Icon
Joined: 26 Nov, 2004
Posts: 3,812



Thanked 27 times

Dream Kudos: 2800

Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions


You will also need _defs.h since graphics.h uses it.
User is offlineProfile CardPM

Go to the top of the page

lanec42
post 19 Jul, 2008 - 01:46 AM
Post #9


D.I.C Head

Group Icon
Joined: 26 Mar, 2008
Posts: 134


My Contributions


Oh my GOD! I've been looking for a good Linux compiler lately (Ubuntu == crack) and this is IT! </dream.in.code> rocks. Thanks, gabehabe.
EDIT: And b2c. I needed that.

This post has been edited by lanec42: 19 Jul, 2008 - 01:47 AM
User is offlineProfile CardPM

Go to the top of the page

MorphiusFaydal
post 19 Jul, 2008 - 08:01 PM
Post #10


D.I.C Lover

Group Icon
Joined: 12 May, 2005
Posts: 1,054



Thanked 7 times

Expert In: Hardware, Networking

My Contributions


QUOTE(gabehabe @ 18 Jul, 2008 - 11:07 AM) *

Code::Blocks is my favourite smile.gif

Note,
Borland is the only compiler with a library called "graphics"

You will need to copy it from your Borland compiler directory into your new compiler directory.

I second his nomination for using Code::Blocks. I also use Microsoft Visual C++ 2008 Express, but usually only when I am looking at other people projects that are in VS.
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 10/13/08 05:08AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month