Hi everyone I need help with something

i get this error

fatal error C1075: end of file found before the left brace '{' at 'c:\documents and settings\navideeah\desktop\maplestoryserver\maplestoryserver\mapleisland.cpp(350)' was matched

and i get the error around here

void NPCsScripts::npc_22000(NPC* npc){
	int state = npc->getState();
	int map = npc->getPlayerMap();
	if(npc->getPlayerMap() == 0){
		if(state == 0){
			npc->addText("Hey hows it going, I'm Shanks, the Driver of this magnificent ship ");
			npc->addText("Are you getting tired of this place, well I can take you out of here FOREVER!!");
			npc->addText("Just a warning though, once you leave, you will enter the real world, and it is much harder to survive out there, trust me");
			npc->sendYesNo();
		}
		else if(state == 1){
			if(npc->getSelected() == YES){
				npc->addText("Ok then, I'm going to get you out of this place, say goodbye to this place forever, and hey, dont forget to visit me.");
				npc->sendNext();
			}
			else {
				npc->addText("Are you positive you dont want to leave this place?");
				npc->setState(npc->getState()+1);
				npc->sendYesNo();
			}
		}
		else if(state == 2){
			npc->teleport(1);
			npc->end();
		}
		else if(state == 3){
			if(npc->getSelected() == NO){
				npc->addText("Please talk to me once you can get a yes so I can take you out of here, I've got important things to do you know.");
				npc->sendNext();
				npc->end();
			}
		}
		else if(state == 4){
			npc->teleport(40000);
			npc->end();
		}

somewhere in there It gives me the error of

fatal error C1075: end of file found before the left brace '{' at 'c:\documents and settings\navideeah\desktop\maplestoryserver\maplestoryserver\mapleisland.cpp(350)' was matched

if anyone knows what im missing and where it is post a reply because this is the only error I have and I would like to get it fixed

Thanks

Recommended Answers

All 21 Replies

isn't it obvious what your program is missing? There error message said it all -- the { and } do not match. I can't tell you which one is missing because you didn't post all the code.

Hi everyone I need help with something

i get this error

fatal error C1075: end of file found before the left brace '{' at 'c:\documents and settings\navideeah\desktop\maplestoryserver\maplestoryserver\mapleisland.cpp(350)' was matched

and i get the error around here

void NPCsScripts::npc_22000(NPC* npc){
	int state = npc->getState();
	int map = npc->getPlayerMap();
	if(npc->getPlayerMap() == 0){
		if(state == 0){
			npc->addText("Hey hows it going, I'm Shanks, the Driver of this magnificent ship ");
			npc->addText("Are you getting tired of this place, well I can take you out of here FOREVER!!");
			npc->addText("Just a warning though, once you leave, you will enter the real world, and it is much harder to survive out there, trust me");
			npc->sendYesNo();
		}
		else if(state == 1){
			if(npc->getSelected() == YES){
				npc->addText("Ok then, I'm going to get you out of this place, say goodbye to this place forever, and hey, dont forget to visit me.");
				npc->sendNext();
			}
			else {
				npc->addText("Are you positive you dont want to leave this place?");
				npc->setState(npc->getState()+1);
				npc->sendYesNo();
			}
		}
		else if(state == 2){
			npc->teleport(1);
			npc->end();
		}
		else if(state == 3){
			if(npc->getSelected() == NO){
				npc->addText("Please talk to me once you can get a yes so I can take you out of here, I've got important things to do you know.");
				npc->sendNext();
				npc->end();
			}
		}
		else if(state == 4){
			npc->teleport(40000);
			npc->end();
		}

somewhere in there It gives me the error of

fatal error C1075: end of file found before the left brace '{' at 'c:\documents and settings\navideeah\desktop\maplestoryserver\maplestoryserver\mapleisland.cpp(350)' was matched

if anyone knows what im missing and where it is post a reply because this is the only error I have and I would like to get it fixed

Thanks

OK THIS IS THE ENTIRE THING, HOPE SOMEONE CAN SEE WHAT IM MISSING

#include "NPCs.h"
#include "NPCsScripts.h"


void NPCsScripts::npc_2100(NPC* npc){
	int state = npc->getState();
	int map = npc->getPlayerMap();
	if(npc->getPlayerMap() == 0){
		if(state == 0){
			npc->addText("Welcome to the world of MapleStory. The purpose of this training camp is to ");
			npc->addText("help beginners. Would you like to enter this training camp? Some people start thier journey ");
			npc->addText(" without taking the training program. But I strongly recommend you take the training program first.");
			npc->sendYesNo();
		}
		else if(state == 1){
			if(npc->getSelected() == YES){
				npc->addText("Ok then, I will let you enter the training camp. Please follow your instructor's lead.");
				npc->sendNext();
			}
			else {
				npc->addText("Do you really wanted to start your journey right away?");
				npc->setState(npc->getState()+1);
				npc->sendYesNo();
			}
		}
		else if(state == 2){
			npc->teleport(1);
			npc->end();
		}
		else if(state == 3){
			if(npc->getSelected() == NO){
				npc->addText("Please talk to me again when you finally made your decision.");
				npc->sendNext();
				npc->end();
			}
			else{
				npc->addText("It seems like you want to start your journey without taking the ");
				npc->addText("training program. Then, I will let you move on the training ground. Be careful~");
				npc->sendNext();
			}
		}
		else if(state == 4){
			npc->teleport(40000);
			npc->end();
		}
	}
	else if (map == 1){
		if(state == 0){
			npc->addText("The is the image room where your first training program begins. ");
			npc->addText("In this room, you will have an advance look into the job of your choice. ");
			npc->sendNext();
		}
		else if(state == 1){
			npc->addText("Once you train hard enough, you will be entitled to occupy a job. ");
			npc->addText("You can become a Bowman in Henesys, a Magician in Ellinia, a Warrior in Perion, and a Thief in Kerening City..");
			npc->sendBackOK();
		}
		else if(state == 2){
			npc->end();
		}
	}
	else{
		npc->end();
	}
}

void NPCsScripts::npc_2101(NPC* npc){
	int state = npc->getState();
	if(state == 0){
		npc->addText("Are you done with your training? ");
		npc->addText("If you wish, I will send you out from this training camp.");
		npc->sendYesNo();
	}
	else if(state == 1){
		if(npc->getSelected() == YES){
			npc->addText("Then, I will send you out from here. Good job.");
			npc->sendNext();
		}
		else{
			npc->addText("Haven't you finish the training program yet? ");
			npc->addText("If you want to leave this place, please do not hesitate to tell me.");
			npc->sendOK();
		}
	}
	else if(state == 2){
		if(npc->getSelected() == YES){
			npc->teleport(3);
		}
		npc->end();
	}
}

void QuestsScripts::npc_2000s(NPC* npc){
	int state = npc->getState();
	if(state == 0){
		npc->addText("Hey there, Pretty~ I am Roger who teachs you adroable new Maplers with lots of information.");
		npc->sendNext();
	}
	else if(state == 1){
		npc->addText("I know you are busy! Please spare me some time~ I can teach you some useful information! Ahahaha!");
		npc->sendBackNext();
	}
	else if(state == 2){
		npc->addText("So..... Let me just do this for fun! Abaracadabra~!");
		npc->sendAcceptDecline();
	}
	else if(state == 3){
		if(npc->getSelected() == ACCEPT){
			npc->setPlayerHP(25);
			npc->giveItem(2010007, 1);
			npc->addQuest(1021);
			npc->setState(npc->getState()+1);
			npc->addText("Surprised? If HP becomes 0, then you are in trouble. Now, I will give you #r#t2010007##k. Please take it. ");
			npc->addText("You will feel stronger. Open the Item window and double click to consume. Hey, It's very simple to open the Item window. Just press #bI#k on your keyboard.");
			npc->sendNext();
		}
		else{
			npc->addText("I can't believe you just have turned down a attractive guys like me!");
			npc->sendNext();
			npc->end();
		}
	}
	else if(state == 4){
		npc->addText("Surprised? If HP becomes 0, then you are in trouble. Now, I will give you #r#t2010007##k. Please take it. ");
		npc->addText("You will feel stronger. Open the Item window and double click to consume. Hey, It's very simple to open the Item window. Just press #bI#k on your keyboard.");
		npc->sendNext();
	}
	else if(state == 5){
			npc->addText("Please take all #t2010007#s that I gave you. You will be able to see the HP bar increasing. "); 
			npc->addText("Please talk to me again when you recover your HP 100%");
			npc->sendBackOK();
	}
	else if(state == 6){
		npc->end();
	}
}
void QuestsScripts::npc_2000e(NPC* npc){
	int state = npc->getState();
	if(state == 0){
		npc->addText("How easy is it to consume the item? Simple, right? You can set a #bhotkey#k on the right bottom slot. Haha you didn't know that! right? ");
		npc->addText("Oh, and if you are a begineer, HP will automatically recover itself as time goes by. Well it takes time but this is one of the strategies for the beginners.");
		npc->sendNext();
	}
	else if(state == 1){
		npc->addText("Alright! Now that you have learned alot, I will give you a present. This is a must for your travle in Maple World, so thank me! Please use this under emergency cases!");
		npc->sendBackNext();
	}
	else if(state == 2){
		npc->addText("Okay, this is all I can teach you. I know it's sad but it is time to say good bye. Well tack care of yourself and Good luck my friend!\r\n\r\n");
		npc->addText("#fUI/UIWindow.img/QuestIcon/4/0#\r\n#v2010000# 3 #t2010000#\r\n#v2010009# 3 #t2010009#\r\n\r\n#fUI/UIWindow.img/QuestIcon/8/0# 10 exp");	
		npc->sendBackNext();
	}
	else if(state == 3){
		npc->endQuest(1021);
		npc->giveItem(2010000, 3);
		npc->giveItem(2010009, 3);
		npc->giveEXP(10);
		npc->end();
		
	}

}

void NPCsScripts::npc_9101001(NPC* npc){
	int state = npc->getState();
	if(state == 0){
		npc->addText("You have finished all your trainings. Good job. ");
		npc->addText("You seem to be ready to start with the journey right away! Good , I will let you on to the next place.");
		npc->sendNext();
	}
	else if(state == 1){
		npc->addText("But remember, once you get out of here, you will enter a village full with monsters. Well them, good bye!");
		npc->sendBackNext();
	}
	else if(state == 2){
		npc->teleport(40000);
		npc->end();

	}
}

void NPCsScripts::npc_2020005(NPC* npc){
	char npcs[10][20] = {"0022000", "2012019", "2030002", "2030009", "2081006", "1061013", "2010003", "1052006", "1061000", "2060003"};
	char npcnames[10][20] = {"Shanks", "Moppie", "Corporal Easy", "Glivver", "Moira", "Gwin", "Neve", "Jake", "Chrishrama", "Melias"};
	char npcmaps[10][30] = {"Southperry", "Orbis", "Cloud Park VI", "Ice Valley II", "Cave of Life - Entrance", "Another Entrance", "Orbis Park", "Subway Ticketing Booth", "Sleepywood", "Department Store"};
	char scrolls[14][20] = {"2043001", "2043101", "2043201", "2043301", "2043701", "2043801", "2044001", "2044101", "2044201", "2044301", "2044401", "2044501", "2044601", "2044701"};
	int state = npc->getState();
	if(state == 0){
		npc->addText("In my old age, I've forgotten many of my friends names from far and distant lands. Can you help me remember them?");
		npc->sendAcceptDecline();
	}
	else if(state == 1){
		if(npc->getSelected() == DECLINE){
			npc->end();
			return;
		}
		npc->addText("Thank you. My mind's sharpness has left me years ago *chuckles*. My pocketbook still contains many pictures of friends from long ages past. Many of my friends I'm sure you'll find very familiar, ");
		npc->addText("however some of my newer friends will probably be just as difficult for you as it is for me. I'm sure you've had the ability to meet all of these people. After all, that ship in Cloud City can only take you so far, mmm?");
		npc->sendNext();
	}
	else if(state == 2){
		npc->addText("I have two questions for you for every picture in my pocketbook, and I have ten forgetful memories. #bIf you could be so kind as to not only tell me the name of the person, but also where I might find that person?#k ");
		npc->addText("Should you say something that perhaps jogs my memory a bit, perhaps I will reward you. Take as long as you like - by Merlin's beard I'm in no hurry. Are you ready to begin this quiz?");
		npc->sendYesNo();
	}
	else if(state >= 3 && state <= 32){
		if(npc->getSelected() == NO){
			npc->end();
			return;
		}
		if((state-3)%3 == 0){
			if(state-3!=0){
				if(strcmp(npc->getText(), npcmaps[(state-3)/3-1]) == 0){
					npc->setVariable("count", npc->getVariable("count")+1);
				}
			}
			if((state-3)/3+1>=10){
				npc->addChar(((state-3)/3)/10+'1');
				npc->addChar(((state-3)/3+1)%10+'0');
			}
			else
				npc->addChar((state-3)/3+'1');
			npc->addText(".\r\n#fNpc/");
			npc->addText(npcs[(state-3)/3]);
			npc->addText(".img/stand/0#");
			npc->sendNext();
		}
		else if((state-3)%3 == 1){
			npc->addText("What is his name?");
			npc->sendGetText();
		}
		else if((state-3)%3 == 2){
			if(strcmp(npc->getText(), npcnames[(state-3)/3]) == 0){
				npc->setVariable("count", npc->getVariable("count")+1);
			}
			npc->addText("And where can I find him?");
			npc->sendGetText();
		}
	}
	else if(state == 33){
		if(strcmp(npc->getText(), npcmaps[(state-3)/3-1]) == 0){
			npc->setVariable("count", npc->getVariable("count")+1);
		}
		npc->addText("Thank you so much for hel... hold on just a moment. Ah, dear me! I left a list of these people's names in here should I ever forget. Wonderful, now I feel foolish! ");
		npc->addText("Well, a deal is a deal. I'll reward you based upon the ones you got correct.");
		npc->sendNext();
	}
	else if(state == 34){
		int count = npc->getVariable("count");
		if(count <= 5){
			npc->addText("You get nothing. You don't know your NPC!");
		}
		else if(count <= 10){
			npc->addText("#fUI/UIWindow.img/QuestIcon/7/0#\r\n#fItem/Special/0900.img/09000003/iconRaw/0# 1,000,000 Mesos");
		}
		else if(count <= 15){
			npc->addText("#fUI/UIWindow.img/QuestIcon/7/0#\r\n#fItem/Special/0900.img/09000003/iconRaw/0# 3,000,000 Mesos\r\n\r\n#fUI/UIWindow.img/QuestIcon/4/0#\r\n#v2070005# #t2070005#");
		}
		else if(count <= 19){
			npc->addText("#fUI/UIWindow.img/QuestIcon/7/0#\r\n#fItem/Special/0900.img/09000003/iconRaw/0# 10,000,000 Mesos\r\n\r\n#fUI/UIWindow.img/QuestIcon/4/0#\r\n#v2070005# #t2070005#\r\n\r\n#fUI/UIWindow.img/QuestIcon/3/0#");
			for(int i=0; i<14; i++){
				npc->addText("\r\n#L");
				if(i>=10)
					npc->addChar(i/10+'0');
				npc->addChar(i%10+'0');
				npc->addText("##v");
				npc->addText(scrolls[i]);
				npc->addText("# #t");
				npc->addText(scrolls[i]);
				npc->addText("##l");
			}
			npc->addText("\r\n");
		}
		else{
			npc->addText("#fUI/UIWindow.img/QuestIcon/7/0#\r\n#fItem/Special/0900.img/09000003/iconRaw/0# 12,000,000 Mesos\r\n\r\n#fUI/UIWindow.img/QuestIcon/4/0#\r\n#v2070006# #t2070006#\r\n#v4001102# Alcaster's Statue\r\n\r\n#fUI/UIWindow.img/QuestIcon/3/0#");
			for(int i=0; i<14; i++){
				npc->addText("\r\n#L");
				if(i>=10)
					npc->addChar(i/10+'0');
				npc->addChar(i%10+'0');
				npc->addText("##v");
				npc->addText(scrolls[i]);
				npc->addText("# #t");
				npc->addText(scrolls[i]);
				npc->addText("##l");
			}
			npc->addText("\r\n");
		}
		if(count>15)
			npc->sendSimple();
		else
			npc->sendOK();
	}
	else if(state == 35){
		int count = npc->getVariable("count");
		if(count <= 5){
		}
		else if(count <= 10){
			npc->giveMesos(1000000);
		}
		else if(count <= 15){
			npc->giveMesos(3000000);
			npc->giveItem(2070005, 1);
		}
		else if(count <= 19){
			npc->giveMesos(10000000);
			npc->giveItem(2070005, 1);
			npc->giveItem(strval(scrolls[npc->getSelected()]), 1);
		}
		else {
			npc->giveMesos(12000000);
			npc->giveItem(4001102, 1);
			npc->giveItem(2070006, 1);
			npc->giveItem(strval(scrolls[npc->getSelected()]), 1);
		}
		npc->end();

	}
}


/* void NPCsScripts::npc_2100(NPC* npc){
	char arr[2][90] = {"60000", "221000300"};
	int state = npc->getState();
	if(state == 0){
		npc->addText("#bBe prepared#k ;)))");
		npc->sendNext();
	}
	else if(state == 1){
		npc->addText("CHOOOOOSE! BOHAHAHAHAHAH ;))#b");
		for(int i=0; i<2; i++){
			npc->addText("\r\n#L");
			npc->addChar(i+'0');
			npc->addText("##m");
			npc->addText(arr[i]);
			npc->addText("##l");
		}
		npc->sendSimple();
	}
	else if(state == 2){
		npc->teleport(strval(arr[npc->getSelected()]));
		npc->end();
	}
}
*/

void NPCsScripts::npc_22000(NPC* npc){
	int state = npc->getState();
	int map = npc->getPlayerMap();
	if(npc->getPlayerMap() == 0){
		if(state == 0){
			npc->addText("Hey hows it going, I'm Shanks, the Driver of this magnificent ship ");
			npc->addText("Are you getting tired of this place, well I can take you out of here FOREVER!!");
			npc->addText("Just a warning though, once you leave, you will enter the real world, and it is much harder to survive out there, trust me");
			npc->sendYesNo();
		}
		else if(state == 1){
			if(npc->getSelected() == YES){
				npc->addText("Ok then, I'm going to get you out of this place, say goodbye to this place forever, and hey, dont forget to visit me.");
				npc->sendNext();
			}
			else {
				npc->addText("Are you positive you dont want to leave this place?");
				npc->setState(npc->getState()+1);
				npc->sendYesNo();
			}
		}
		else if(state == 2){
			npc->teleport(1);
			npc->end();
		}
		else if(state == 3){
			if(npc->getSelected() == NO){
				npc->addText("Please talk to me once you can get a yes so I can take you out of here, I've got important things to do you know.");
				npc->sendNext();
				npc->end();
			}
		}
		else if(state == 4){
			npc->teleport(40000);
			npc->end();

Please tell me if you can help me solve this error and the error again is

fatal error C1075: end of file found before the left brace '{' at 'c:\documents and settings\navideeah\desktop\maplestoryserver\maplestoryserver\mapleisland.cpp(350)' was matched

What part of the error message are you having difficulty comprehending?

void NPCsScripts::npc_22000(NPC* npc){
	int state = npc->getState();
	int map = npc->getPlayerMap();
	if(npc->getPlayerMap() == 0){
		if(state == 0){
			npc->addText("Hey hows it going, I'm Shanks, the Driver of this magnificent ship ");
			npc->addText("Are you getting tired of this place, well I can take you out of here FOREVER!!");
			npc->addText("Just a warning though, once you leave, you will enter the real world, and it is much harder to survive out there, trust me");
			npc->sendYesNo();
		}
		else if(state == 1){
			if(npc->getSelected() == YES){
				npc->addText("Ok then, I'm going to get you out of this place, say goodbye to this place forever, and hey, dont forget to visit me.");
				npc->sendNext();
			}
			else {
				npc->addText("Are you positive you dont want to leave this place?");
				npc->setState(npc->getState()+1);
				npc->sendYesNo();
			}
		}
		else if(state == 2){
			npc->teleport(1);
			npc->end();
		}
		else if(state == 3){
			if(npc->getSelected) == NO){
				npc->addText("Please talk to me once you can get a yes so I can take you out of here, I've got important things to do you know.");
				npc->sendNext();
				npc->end();
			}
		}
		else if(state == 4){
			npc->teleport(40000);
			npc->end();
		}

I'm specifically having problems somewhere around the text above and this is the error

fatal error C1075: end of file found before the left brace '{' at 'c:\documents and settings\navideeah\desktop\maplestoryserver\maplestoryserver\mapleisland.cpp(350)' was matched

Accoding to this im missing a brace or i put one extra but i tried and i cant find out, if anyone can find the error please comment me and tell me

THANKS

You will have count the braces. For each { there must be a matching }.

>>OK THIS IS THE ENTIRE THING, HOPE SOMEONE CAN SEE WHAT IM MISSING
Just look at the last line of the code you posted. The code isn't all there because the last function is not complete.

And please use code tags the next time you dump all that code here. Here is how to do it.

[code=cplusplus] // your code goes here

[/code]

Also please read this thread.

Thanks for the help ill see if it helps and ill contact you if it dusnt when ur online

ANYONE ELSE READING THIS FEEL FREE TO GIVE ME YOUR RESPONSES FROM YOUR OPINION

THANks

Thanks for the help ill see if it helps and ill contact you if it dusnt when ur online

ANYONE ELSE READING THIS FEEL FREE TO GIVE ME YOUR RESPONSES FROM YOUR OPINION

THANks

As others have said, the error is clear, though it can be time-consuming to track down. You have a brackets problem. Somewhere there is a starting { with no matching ending }. Your job is to find it. Constant code indentation is critical for this. I personally prefer to use this type of formatting:

int main ()
{
     return 0;
}

rather than this type:

int main () {
     return 0;
}

since I find brackets matching easier using the first way. There are also many good IDEs like NetBeans and Visual Studio where you can minimize and expand bracket sections quickly by clicking the + and - signs next to the brackets. If you have a very short function and expanding the function makes it 100 lines long, chances are that's your problem. The method is kind of trial and error and methodical noting of starting and ending brackets line numbers on a piece of paper till you find an extra bracket or a missing bracket. You can also quickly comment out and put back in large chunks of code sometimes, but mostly it's plain old boring brackets counting.

commented: I like that style of coding too :) +29

Another way I have used to find missing braces is to comment out large blocks of code until the error goes away. You can narrow down the problem that way.

PLAYST205: this is a Really. Common. Problem. one day you may have the unfortunate luck to revisit your posts here, and you'll be (rightfully) embarrassed at just how whiny and helpless you're acting over something so trivial and mundane.

ANYHOW... most text editors have a hotkey that will locate the mate for any given brace/bracket/parenthesis. for this very problem. For instance, in TextPad, I click on any brace, hit CTRL-M, and it takes me to its corresponding mate. MSVC++ and Code::Blocks have something similar.

go through your braces looking for the mates like that, and soon enough you will find that it cant locate the matching brace, or it thinks a match is something that obviously isnt. therein will be your missing/extra brace


.

jephthah's suggestion works very well, except when there are braces within quotes. The macros used to find matching quotes will treat quoted braces as one of the matches. And that sucks. I wind up replacing quoted braces with something else so that I can easily restore them later.

commented: i learn something new every day. +2

around here, i learn something new every day. and typically from the same 3 or 4 people :)

.

Found a command before the "left key" (End of statement)
Correct this error in the line of !

commented: Meaningless, as it's 3 years TOO LATE - read the rules about digging old threads -4
commented: bumping 3 year old thread -4

merci all of you that was my problem too and i could solve it,thanks a lot

I am having the exact same problem but i can't seem to figure out the missing or added brackets, they all link up. none missing and none extra

Can't help you until you post the code.

From the code you did paste, you are missing a terminating '}' in npc_22000(). So, if this is not the issue, as per AD, please post ALL of your code... :-)

this is David's first post, so he hasn't posted any code at all yet.

#include<iostream>
#include<string>
#include<Windows.h>// colur 
using namespace std;
void welcome();
void selectoption();
void loginmenu();
void loginadmin();
void loginuser();
void displaymenu();
void Help();
void special_Offers();
void dis();
void informe();
void menulist();

struct bookdtl

{
    int bkid;
    string des;
    double unitprce;

}menu[4];

void main()
{
    welcome();

    system("pause");
}
void welcome()
{
    HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleTextAttribute(h,FOREGROUND_BLUE|FOREGROUND_INTENSITY |FOREGROUND_GREEN);


    cout << " * * * * *   *         *   * * * * *  *         *  * * * * *    * * * * *                                                         " << endl;
    cout << " *           *         *       *      *         *  *       *    *                     "<<endl;
    cout << " * * * * *    *       *        *       *       *   * * * * *    * * * * *              " << endl;
    cout << " *              * * *          *         * * *     *      *     *                     "<<endl;
    cout << " *                                                 *        *   * * * * *             " << endl;
    cout << "                                                                                  "     <<endl;
    cout << "  *        *    * * * * *   * * * * * *    *              * * * * * *                                               "     <<endl;
    cout << "  *        *    *       *   *         *    *                 *      *                            " <<endl;
    cout << "  *        *    *       *   * * * * * *    *                 *      *                                   " << endl;
    cout << "  *    *   *    *       *   *     *        *                 *      *                                 " << endl;
    cout << "  *  *   * *    * * * * *   *       *      *                 *      *                                   " << endl;
    cout << "  *        *                *         *    * * * * * *    * * * * * *                                      " << endl;

                                                                    cout << "design by thiru pivat (ltd)" << endl;
    cout << "you want login admin enter A" << endl;
    cout << "you want login user enter B" << endl;
    loginmenu();
}
void loginmenu()
{
    char opt;

    cout << "A,B select one option to continue" << endl;
    cin >> opt;

    switch (opt)
    {
    case 'A':
        cout << "you have selected admin login:" << endl;
        loginadmin();
        break;

    case 'B':
        cout << "you have selected user login:" << endl;
        loginuser();
        break;

    default:
        cout << "Please enter one of the given option " << endl;
        cout << "\n";
        loginadmin();

        system("pause");
    }
    void loginadmin();
    {
        string username;
        string password;
        int counter = 3;
        do
        {
            cout << "enter username" << endl;
            cin >> username;
            cout << "enter password" << endl;
            cin >> password;

            if ((username == "futureworld") && (password == "123"))
            {
                cout << "you have entered correct user name and password" << endl;
                cout << "\n";

                break;
            }

            else
            {
                cout << "invalid username and password....try again" << endl;
                cout << "\n";
            }

            counter--;
        }

        while (counter > 0);
        {

            if (counter == 0)
            {
                cout << "unauthorized user......" << endl;
                system("pause");
                exit(1);
            }

            else
            {
                cout << "welcome to the future world" << endl;
                cout << "\n";
                displaymenu();

                system("pause");

            }
        }   }
    void userlogin();

        {
            string username;
            string password;
            int counter = 3;
            do
            {
                cout << "enter username" << endl;
                cin >> username;
                cout << "enter passsword" << endl;
                cin >> password;

                if ((username == "user") && (password == "1234"))
                {
                    cout << "access granted....";
                    break;
                    cout << "\n";
                }
                else
                {

                    cout << "access denied....invaild username/password:" << endl;
                }
                counter--;
            } while (counter>0);


            if (counter == 0)
            {
                cout << "unauthorized user contact help desk" << endl;
                system("pause");
                exit(1);//returns 1 to the operating system

            }
            else
                cout << "welcome to the system" << endl;

            displaymenu();

            system("pause");
        }
    void displaymenu();
    {
        cout << "\n\n" << endl;
        cout << " @=====~~~~~~~~~~~~====@ " << endl;
        cout << "  Futureworld Book Shop " << endl;
        cout << " @=====================@" << endl;
        cout << "\n\n" << endl;
        cout << " ______________________" << endl;
        cout << "1. Help                 |" << endl;
        cout << "2. List Of Book        |" << endl;
        cout << "3. Special Offers      |" << endl;
        cout << "4. Search Book details |" << endl;
        cout << "_______________________|" << endl;
        menulist();
    }
    void menulist();
    {
        //declaring part
        bool pro = false;
        int opt = 0;


        cout << "\n\n";

        while (pro == false)
        {

            cout << "Select Any Option : " << endl;
            cin >> opt;


            switch (opt)
            {
            case 1:
                Help();
                break;

            case 2:

                break;

            case 3:
                special_Offers();
                break;

            case 4:

                break;

            default:
                cout << "You Have Entered Invalid Option !" << endl;
                system("pause");
            }
            //endcase
            char need;
            cout << "Do You Want to continue the program : ";
            cin >> need;
            cout << "\n\n";

            if (need == 'y')
            {

                displaymenu();

            }

            else
            {
                cout << "Thakyou So Much !!! :) :) :)" << endl;
                system("pause");
                exit(0);
            }



        }

        cout << "Enter Option No: ";
        cin >> opt;


        system("pause");
    }

    void Help();
    {
        cout << " Vaaagana" << endl;
    }

    void special_Offers();
    {

        informe();

        cout << "\n";

        dis();

        system("pause");
    }
    void dis(); {

        for (int i = 0; i<3; i++)
        {

            cout << " book id :" << menu[i].bkid << endl;
            cout << " book name :" << menu[i].des << endl;
            cout << " unite price :" << menu[i].unitprce << endl;

        }
        system("pause");
    }
    void informe();
    {

        menu[0].bkid = 0001;
        menu[0].des = "lord of the ring";
        menu[0].unitprce = 199.99;
        menu[1].bkid = 0002;
        menu[1].des = "the lord";
        menu[1].unitprce = 123.99;
        menu[2].bkid = 0003;
        menu[2].des = "future ring";
        menu[2].unitprce = 196.99;

    }

plese cheack the error sent the answer

#include <iostream>
using namespace std;

int main()
{
    const int n = 20;
    int Array[n] = { 3, 5, 2, 9, 6, 12, 16, 11, 18, 4, 14, 8, 1, 15, 17, 7, 19, 13, 20, 10 };

    cout << "Not sorted: \n";
    for (int i = 0; i < n; ++i)
    {
        cout << Array[i] << " ";
    }

    cout << endl;

    for (int i = 0; i < n; ++i)
    {
        for (int j = n - 1; j > i; --j)
        {
            if (Array[j] < Array[j - 1])
            {
                int temp = Array[j];
                Array[j] = Array[j - 1];
                Array[j - 1] = temp;
            }
        }
    }

    cout << "Sorted: \n";
    for (int i = 0; i < n; ++i)
    {
        cout << Array[i] << " ";
    }

    cout << endl;

    system("pause");
    return 0;
}

I write this code in c++ but I m new in this and i cant run this
if can solve error of this code
notice me
Inline Code Example Here

#include <cmath>
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>

using namespace std ;

 void main (void)
{
    float   mat[10][10];
    float   k[10];
    int     i,j,p,n;
    int     i1,j1;
    float   z;


    cout << "=== solve dastgah e moadele khati - n moadele n majhool ==\n" ;
    cout << "== method of Guss-Jordan ==\n\n" ;
    cout << "Enter Number of Variables(n) : \n";
    cin >> n ;
    //============= load matrix ==============
    cout << "==== Matris e zarayeb====\n" ;
    for (i=0;i<n;i++){
        for (j=0;j<n;j++) {
            cout << "matrix[" << i << "][" << j << "]" << endl;
            cin >> mat[i][j];
            if ((i==j)&&(mat[i][j]==0)){
                cout << "should not use zero in main diameter.\n";

            //  cout.flush();
                cin.get();

    cin.get();
    cin.get();
    return ;
}
cout << "\n";
    }
    //============= Load Known Array ==============
    cout << "==== Maghadir e maloomb====\n";
    for (i=0;i<n;i++) {
        cout << "k1 : \n";
        cin >> "%f",&k[i] ;
    }
    //============= Chang Arrays To Under-Upper Ziro ==========
    for (i=0;i<n;i++) {
        for (p=0;p<n;p++) {
            if (p!=i)
            {
                z = -mat[p][i]/mat[i][i];
                for (j=0;j<n;j++)
                    mat[p][j]=mat[p][j]+z*mat[i][j];
                k[p] = k[p] + z*k[i];
            }
        }}
        //============= Print Matrix ==============
        for (i1=0;i1<n;i1++) {
            for (j1=0;j1<n;j1++)
                 cout << "%10.4f ",mat[i1][j1] ;
            cout << "%10.4f ",k[i1];
            cout << "\n";
        }
        cout << "\n";
        cin.get();
    }
    //============= Print Result ==============
    for (i=0;i<n;i++) {
        cout << "X%d = %6.4f\n",i,k[i]/mat[i][i] ;
    }
    cin.get();
    cin.get();
    cin.get();
    return ;
}   
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.