C/C++ :: Train Reservation Program - Declaration Terminated Incorrectly

Dec 8, 2013

//PROGRAM - TRAIN RESERVATION
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<dos.h>
#include<stdio.h>
#include<fstream.h>
#include<process.h>

[Code] .....

View 1 Replies


ADVERTISEMENT

C/C++ :: Error Thrown By Compiler / Identifier Expected And Declaration Terminated Incorrectly

Jan 30, 2015

Error message is identifier expected and declaration terminated incorrectly.

//to define a class Employee
#include<iostream.h>
#include<stdio.h>
#include<string.h>
#include<conio.h>
class cEmp {

[code]....

View 7 Replies View Related

C++ :: Error - Declaration Terminated Incorrect

Aug 6, 2014

PROGRAM:-
#include<fstream.h> //for reading and writing files
#include<conio.h> //for clrscr()
#include<string.h> //for string characters
#include<stdio.h> //for gets and puts function
#include<process.h> //for exit function
#include<iomanip.h> //for setw function
#include<dos.h> //for delay and sleep function

void main()
{ char ch,c=0,che=16;
int i=1,j=16;

[Code] .....

View 6 Replies View Related

C++ :: Airport Reservation Program - Binary Files Comparing

Aug 18, 2014

I am working on a airport reservation program and i have run into a brick wall. i want to ask the user its name, gender, passport no, age, destination, and travel class and figure out the day and flight code of the flight which i have saved in a binary file. now every thing works fine except the code and the day.

The programs important section

the flight class Code:
class flights {
char code[9],location[21];
public:
void display();
char *retloc() //to get the Location

[Code] .....

View 13 Replies View Related

C :: Program Is Not Terminated

Feb 26, 2014

I have written the below code,

#include "stdio.h"
int main() {
int c;
while((c=getchar()) != EOF) {
putchar(c);
}
}

The above program is not terminated.how to terminate it?

View 3 Replies View Related

C++ :: Program Crashes After Input - Terminated Called

Oct 28, 2013

My programs complies and runs. However, whenever i try to enter something when prompt to enter the number of accounts i wanted to create my program crashes.

By the way, im using codeblocks.

it says

terminated called after throwing an instance of 'std:: out of range'. what(): basic_string::substr"

Code:
#include <iostream>
#include "clsInterest.h"
#include "clsDate.h"
using namespace std;

[Code] .....

View 8 Replies View Related

Visual C++ :: Priority Queue Sorting Incorrectly

Jan 27, 2013

So i have been banging my head against a wall with this problem for awhile. I have also copy and pasted direct examples from the internet but nothing seems to sort it right.

Node Header

Code:
#ifndef _NODE_H
#define _NODE_H
#include <stdio.h>
class Node {
public:
Node();
Node(int weight, char value, Node* left = NULL, Node* right = NULL);

[Code] ....

View 1 Replies View Related

C/C++ :: How To Change Seat Reservation

Jun 9, 2014

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main(void) {
char answer;//예약 선택
int select1 = 0, select2 = 0, i, j;//필요 변수 선언
int seat[5][5] = { 0 };

[Code] .....

well this is my seat reservation code and my program show the seats like

1 1 2 3 4 5
2 0 0 0 0 0
3 0 0 0 0 0
4 0 0 0 0 0
5 0 0 0 0 0

I want to change these numbers to "■" and "□"(when it's empty seat)

View 1 Replies View Related

C++ :: OpenGL - Outlining Functions Incorrectly When Used With Overlapping Objects

Oct 26, 2013

[URL] This program is creating an outline for each of the tall rectangular prisms that will eventually make up terrain in a game I am making. As you can see in the middle of the picture, the line is not fully connected, and it has smaller lines making up the bigger line like a dotted line. However, this only occurs when two objects overlap (in the part with the dotted lines, the two prisms are touching, as two of their vertices are the same).

How would I make the dotted line go a away and give me a solid line?

Here is my rendering code:
[spoiler]
glDepthFunc(GL_LESS);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glBegin(GL_QUADS);

[Code].....

View 1 Replies View Related

C++ :: Airline Reservation - Assign Seats On Each Flight

Jun 24, 2013

A small airline has just purchased a computer for its new automated reservation system. you have been asked to program a new system. Develop a program to assign seats on each flight of the airline's only plane (capacity = 10 seats) your program should display the following alternatives

Please type 1 for "SMOKING"
Please type 2 for "Non-Smoking"

if the person types 1, your program should assign a seat in the smoking section (seats 1-5). If a person types 2, your program should assign a seats in the non-smoking section (seats 6-10). your program should then print a boarding pass indicating the person's seat number and whether it is in the smoking or non-smoking section of the plane.

Use a single-subscripted array to represent the seating chart of the plane. Initialize all the elements of the array to 0 to indicate that all seats are empty. As each seats is assigned, set the corresponding elements of the array to 1 to indicate that the seat is no longer available.

Your program should never assign a seat that has already been assigned. When the smoking section is full, your program should ask a person if it is acceptable to be placed in the non-smoking area section ( and vice versa ), If yes, make the appropriate a seat assignment. If no, print the message " Next flight leaves in 3 hours! ".

View 5 Replies View Related

C++ :: Airline Reservation Simulator - Binary File Errors

Aug 11, 2014

For a big project for school I have to make an airline reservation simulator but I have run into a problem. I want to save the the flight code and its location in a binary file so that I can obtain a code according to the location but this happens:

[URL] ... (link to current output and expected output)

Here is the source class

class file {
private:
char code[8];
char from[20];
public:
void input();

[Code] ....

View 4 Replies View Related

C/C++ :: Too Many Types In Declaration In A Basic Structure Program

May 18, 2014

This is my program

#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
#include<math.h>    
struct date
{int dd,mm,yy;}  

[Code] ....

Error in Line 11:Too many types in declaration

View 2 Replies View Related

C/C++ :: Null Terminated String Function

Feb 12, 2015

how would I write a function that copies a null-terminated string from one char* buffer to another, without using strcpy? I am trying to avoid strcpy because of the null terminator.

Here is my attempt;

#include <algorithm>
#include <iostream>
static const size_t, data_size =32;
struct tString
{
char data[data_size];
};
std::string buffer = strArray1[0] + strArray2[0];
std::copy(buffer.begin(), buffer.end(), tString[0].data);

View 8 Replies View Related

C/C++ :: GDB Core Generated After Application Gets Terminated

Aug 16, 2013

My C++ application gets crashed after throwing the gdb core

"warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fff79e54000"

Core was generated by `./server'.
Program terminated with signal 6, Aborted.
#0 0x0000003b67230265 in raise () from /lib64/libc.so.6

View 1 Replies View Related

C :: Counting A Stream Of Non-null Terminated Bytes

Oct 7, 2014

I want to count the number of bytes in a stream that contains nulls. I know I can't use strlen() for this, so is there an alternative?

Code:
char *bytes = "x11x12x13x00x12x13x14x15";

I want to be able to say there's 8 bytes here, not 3 as strlen gives me.

View 3 Replies View Related

C# :: MySQL Exception Connection Unexpectedly Terminated

Jul 10, 2014

I am currently developing a sync module using asp.net. I am getting data from an external database (mysql database) The problem is I am getting the error "Connection unexpectedly terminated" when filling the dataset.

Here's my code

string P_contact = "SELECT A.id, B.firstname, B.middlename, B.lastname FROM Accounts A, Contacts B WHERE A.id = B.id";
MySqlDataAdapter db_P_contact = new MySqlDataAdapter(P_contact, conn);
DataSet ds3 = new DataSet();
DataTable dt3 = new DataTable();

[Code] ....

I am getting the exception on this line of code:

db_P_contact.Fill(ds3, "P_contact");

View 3 Replies View Related

C++ :: Using Same Declaration Value More Than Once

Oct 11, 2014

I am trying to make a menu program and was wondering if there is a way to declare something more than once without using a different word.

ex.

#include <iostream>
using namespace std;
double grams, ounces, inches, feet, meters; //units to convert
int choice; //menu choice
int main() {
cout << "Welcome to Measurement Converter" << endl;

[Code] .....

I dont really know how to explain it but im trying to use int choice to make choose a program from a simple list.

View 4 Replies View Related

C++ :: Different Array Declaration

Jan 7, 2013

I would like to know the difference between the following two forms of array declaration:

(1)double myArray[3] = {1.0, 2.0, 3.0};

(2)array<double,3> myArray = {1.0, 2.0, 3.0};

If I say the second one allows to use different functions like .begin(), am I right? Is there any other difference between these two declaration?

View 6 Replies View Related

C++ :: Using Declaration Within Name Space Scope

Mar 16, 2013

Can we use using declaration within name space scope? is it safe to use it?

I think we can use using declaration for class scope and function scope only.

View 9 Replies View Related

C :: Assigning Value During Pointer Declaration

Aug 31, 2013

I am trying to understand the behavior of following code. Basically how does printf() prints the value rather than address.

Does initializing value to a pointer during declaration makes a difference when assigned from a variable?

Code:

1 #include <stdio.h>
2
3 int main() {
4 const char *var1 = 'A';
5 int *vint = 10;

[Code] ....

View 8 Replies View Related

C :: Declaration And Definition Of A Variable

May 11, 2013

I read that Memory is allocated during definition of a variable and not during declaration. Declaration is something like,

Code: int x;

And definition is assigning some value to it. This is what my professor taught. My doubt is if memory is not allocated during declaration, then how the compiler successfully compiles and runs the following, which i had already tried.

Code:
#include<stdio.h>
#include<conio.h>
int main() {
int c;
int *p=&c;
printf("%x",p);
getch();
return 0;
}

The variable c is only declared. But the program outputs a memory address. Shouldn't it show an error?

View 2 Replies View Related

C++ :: Cstddef Declaration Errors

Feb 17, 2013

I've included <cstddef> into a project of mine in favour of <stddef.h>. When I tried to compile my project, I get 50+ errors stating that types such as "::size_t", "::div_t" and "::abort( )" have not been declared even though <cstddef> includes <stddef.h>.

I've tried searching both the global namespace and the standard namespace, but neither way works. At this moment in time, I don't have any compiler options enabled that may affect the way identifiers are defined, C++11 isn't enabled (which doesn't affect the <cstddef> header anyway), the project is a C++ project, and I've tried using the plain old <stddef.h> header, but the problems still persist.

I'm using GNU's C++ compiler ("__GNUG__" is defined).

View 3 Replies View Related

C++ :: Constant Declaration In Function

Jan 20, 2013

What is the difference between:

const int testFunction() &
int testFunction() const

View 3 Replies View Related

C++ :: Does Order Of Declaration Matter

Jul 25, 2013

I have recently found this article: URL.....In their example, by declaring variables in other order, they saved 8 bytes. However, shouldn't compiler take care of it? Is it true, and should I declare variables more carefully?

View 3 Replies View Related

C++ :: Static Variable Declaration

Oct 4, 2014

If i declare 2 variables like this static int first, second; will both of them be declared static or will only first be declared static and second a regular variable?

View 5 Replies View Related

C++ :: Bitset Declaration In Class

Jan 24, 2014

I've got some problems with the declaration of a bitset container in my class

I've got a class A and want to have a bitset container in it, whose size just get's defined when running an instance of this class:

#include <bitset>
class A {
bitset <n> bc;
A(int n) : n(n) {};
};

Something like that.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved