Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
i want to include graphics to my project but i am getting many errors.here is a small part of my program.



#include<stdio.h>

#include<stdlib.h>

#include<conio.h>

#include<string.h>
#include<graphics.h>

int password();

void addrecord();

void viewrecord();

void editrecord();

void editpassword();

void deleterecord();


struct record

{

char time[6];

char name[30];

char place[25];

char duration[10];

char note[500];

} ;


int main()

{

int ch;

printf("\n\n\t***********************************\n");

printf("\t*PASSWORD PROTECTED PERSONAL DIARY*\n");

printf("\t***********************************");


while(1)

What I have tried:

this is what i have tried but got so many errors.
#include<stdio.h>

#include<stdlib.h>

#include<conio.h>

#include<string.h>
#include<graphics.h>


int password();

void addrecord();

void viewrecord();

void editrecord();

void editpassword();

void deleterecord();
void page(void);

struct record

{

char time[6];

char name[30];

char place[25];

char duration[10];

char note[500];

} ;


int main(){

int gd=DETECT,gm;
initgraph(&gd,&gm,"C\\TURBOC3\\BGI");
setbkcolor(5);
setfillstyle(CLOSE_DOT_FILL,WHITE);
bar(100,100,200,200);
setfillstyle(CLOSE_DOT_FILL,WHITE);
bar(200,200,400,400);
settextstyle(3,0,5);
outtextxy(40,200,"DIARY MANAGEMENT SYSTEM");
sttextstyle(3,0,2);
outtextxy(40,400,"PRESS ENTER TWICE TO CONTINUE");
getch();
closegraph();
if(getch()=='\r'){
page();}
}
void page(void){
int gd=DETECT,gm;
initgraph(&gd,&gd,"C\\TURBOC3\\BGI");
setbkcolor(12);
setfillstyle(CLOSE_DOT_FILL,WHITE);
bar(100,100,200,200);
setfillstyle(CLOSE_DOT_FILL,WHITE);
bar(200,200,400,400);
settextstyle(3,0,5);
outtextxy(40,100,"CREATED BY:");
settextstyle(3,0,3);
outtextxy(40,200,"MICHELLE ");
settextstyle(3,0,3);
outtextxy(40,279,"IFRAH");
getch();
closegraph();
}
Posted
Updated 25-Feb-18 0:24am
Comments
Richard MacCutchan 25-Feb-18 2:17am    
What errors?

1 solution

1) You can't have two main functions.
2) "Unreachable code" is just that: code that cannot be reached so cannot be executed.
For example:
C++
while (1 == 1)
   {
   i++;
   }
   printf("Unreachable");
if you can exit the loop, it isn't unreachable:
C++
while (1 == 1)
   {
   i++;
   if (i == 100) break;
   }
   printf("Reachable");


Stop guessing.
Stop grabbing code and slamming it together then asking questions when it doesn't work.
Start thinking and learning, and plan your code instead of assuming that "it'll fit together and work" - it won't.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900