C++ :: Program To Order Pizza - Empty Controlled Statement Found Error

Aug 25, 2013

I am creating a pizza program for ordering a pizza and I have removed all the errors except for two. I have tried everything I can think of to fix this problem so it will compile, but to no avail. The only errors left are:

1>------ Rebuild All started: Project: Pizza Order App Midterm, Configuration: Debug Win32 ------
1> stdafx.cpp
1> Pizza Order Midterm.cpp
1> Pizza Order App Midterm.cpp
1>c:usersindia-n-jerrydocumentsvisual studio 2010projectspizza order app midtermpizza order app midtermpizza order app midterm.cpp(57): warning C4390: ';' : empty controlled statement found; is this the intent?

[Code] ....

The entire code is listed below seperated into 1 header and 2 cpp files.

// OrderPizzaApp.cpp : Defines the entry point for the console application.//

#include "stdafx.h"
#include "Pizza_Order.h"
#include <iostream>
#include <string>
using namespace std;

// prototypes
Pizza_Order createPizza_Order();

[Code] .....

View 5 Replies


ADVERTISEMENT

C++ :: Error 127 - Process Not Found

Feb 21, 2015

tell me which .dll or library I'm supposed to use to link this program:

#include <iostream>
using namespace std;
void antpost (int num, int& anterior, int& posterior) {
anterior = num-1;
posterior = num+1;

[Code] ....

I think my linker needs an additional #include to be able to deal with int& anterior and int& posterior. I'm not sure as I'm new to C++. My version of Dev-C++ is Orwell V5.8.3.

View 4 Replies View Related

Visual C++ :: Error C2679 - No Operator Found

Oct 19, 2013

I defined a class :

Code:
class A {
public:
enum : char { VA, VB, VC };
};

And another one :

Code:
class B {
A location;
};

In the file B.cpp, when I write :

location = A::VA;

I get an error C2679 binary '=' no operator found ... Why ?

View 11 Replies View Related

C++ :: Fatal Error - One Or More Multiply Defined Symbols Found

Nov 13, 2014

Im getting this error:

"fatal error LNK1169: one or more multiply defined symbols found"

Here's my code:

#include "stdafx.h"
#include <iostream>
using namespace std;
int main () {
cout << "Avoiding Technology" << endl;
bool status = true;
int location;
int a,b;

[Code] ....

View 3 Replies View Related

C/C++ :: Error C1075 - End Of File Found Before The Left Brace

Apr 30, 2014

Full error: error C1075: end of file found before the left brace '{' at 'ConsoleApplication1.cpp(9) was matched

Here is my code

#include "stdafx.h"
#include <iostream>
using namespace std;

[Code]....

View 4 Replies View Related

Visual C++ :: Debugging Library / CXX0017 Error - Symbol X Not Found

Dec 20, 2012

I am debugging a library. I can step into the code however the watch window doesn't show the values of any variables. It will display a message in the value field:

Code:
m_pParentCXX0017: Error: symbol "m_pParent" not found

Interestingly it does show values for local variables in that function but not member functions. Most of my data members are member function though that I want to debug. I am using VS2010.

View 3 Replies View Related

C++ :: Order Of Expression Evaluation In If Statement

Jul 28, 2012

This feels to me like a relatively "deep" C syntax question. Reviewing K&R reveals some interesting, related specifications, but I could not nail this down. The issue is, What determines the order in which expressions are evaluated in an if() statement? Now, K&R gives details with regard to the precedence of operator evaluation, but otherwise I could find only 2 sections detailing the order of expression evaluation (I mention these below). A simple code example demonstrates why this is a burning question to me:

Code:
int checkit(int* pi, BOOL bHavePosValue) {
if ((NULL != pi) && *pi > 0) {
bHavePosValue = TRUE;
return (*pi);}
bHavePosValue = FALSE;
return (0);}

So what if pi is passed in NULL? Is it possible for the *pi expression to be evaluated Before the (NULL != pi) expression? If so, you could have an access fault. If not, what rule of C ensures left-to-right evaluation? Is this a simple case of the left-to-right associativity that K&R shows on page 49 (in the table of operator precedence) for the && operator? Or is there some more general rule that applies?

The two mentions in K&R I did find are that function argument evaluation order is Not defined (pg 86). Also, beyond the order specified in the reference section for operators, they state there is no other defined order. In particular, they state:

"Expressions involving a commutative and associative operator (*, +, &, |, ^) may be rearranged arbitrarily, even in the presence of parentheses; "

That surprised me! I suppose the point is that compiler-made changes in this case cannot change the result. I wonder whether this or other similar rules in C were superseded in C++ ?

In a similar vein, what about the expression evaluation order for the for(,,) statement - does it have guaranteed left-to-right order?

View 2 Replies View Related

C :: Loop Statement To Print Numbers From 1 To 10 In Reverse Order Separated By Star

Apr 21, 2013

Write a for loop statement to print the numbers from 1 to 10 in reverse order separated by star :

10*9*8*7*6*5*4*3*2*1

i try to do it but it show me like this :

10*9*8*7*6*5*4*3*2*1*

how do i write to show me like the first one ?

View 10 Replies View Related

C/C++ :: Program That Count Empty Line And Display Whole File

Jan 6, 2015

I am new in c programming. I want to write a function that will count the empty line of the file and display the content.

/* ***************************
** creator: firstprint *
******************************/

#include <stdio.h>
/* function that will identify if line is empty or not */
is_empty(char *buffer) {
while(isspace(*buffer)) buffer++;
if(*buffer==0x00) return 1;

[Code] ....

View 4 Replies View Related

C++ :: Display Pizza Price By Size After User Input

Mar 13, 2014

How can i write a program that allows a user to enter a size of pizza and then print the price for that size.

Example: if a user enters size ''s'' then it should display the price stored under ''s''

View 3 Replies View Related

C++ :: Program Displays Not Found Even If Find ID Number

Oct 1, 2014

This is just the portion of my program. This program displays Not Found even if the id number is found.

void search(void) {
char ID[10];
int i, found;
cout<<"Enter ID to search: ";
gets(ID);
found=0;
for(i=0;i<top;i++)

[Code] .....

Here's the incorrect output

Enter ID to search: 111

Not found
Name: jude
ID: 111
Semester: 1
Major: IT

I just want to remove the "Not found".

View 1 Replies View Related

C++ :: Getting Error Using Enum In If Statement?

Jan 19, 2014

I'm trying to make a simple C++ program in which the user must try to guess a number, if they guess too high it says "too high" and if they guess too low it says "too low".

I also decided to add a feature which allows them to select how many tries they would like to guess the number. I tried to make "tries" type an enum so if the user could not pick an invalid number but for some reason i cannot use it in an if statement.

here is the code and i am getting the first error on line 27:

Code:
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int guess;

[Code]....

View 7 Replies View Related

C :: Error When Compiling WHILE Statement

Mar 6, 2013

Code:
/* Demonstrates using the gets() return value. */
#include <stdio.h>
/* Declare a character array to hold input, and a pointer. */
char input[257], *ptr;

[Code]....

I just got this from the book that I am using and it is for testing for input of a blank line and readers are being warned in using this format (line 18):

Code: while ( (*ptr = gets(input)) != NULL)

What is the correct syntax if a gcc compiler is to be used?

View 8 Replies View Related

C++ :: Syntax Error If Statement

Feb 19, 2012

I got syntax error in if statement ,, i checked the line i put { after the condition don't know where the mistake are

1>c:usershani est11 est11code.cpp(20) : error C2143: syntax error : missing ';' before 'if'

PHP Code:

# include <iostream>
using namespace std;
int seqsearch (int list[],int length,int key);
void main () {
    int marks [30];

[Code] ....

View 2 Replies View Related

C++ :: Switch Statement - Error At Output

Jul 26, 2012

I have a question related to switch statement, which the switch in class employee2 gives me error at output. Program compiled well. I am using Code::Block Compiler V10.5. I have created object of class employee2 in main() function to get data from user, store it and display it. At the output, Compiler doesn't show actual output what i am expecting. The fun thing is my compiler printed emocion like (), where (hourly/monthly/weekly) was supposed to print.

Code:
#include <iostream>
using namespace std;
enum period {hourly,weekly,monthly};
class employee2 {
private :
char ch;
period x;
double compensation;

[Code] ....

View 10 Replies View Related

C++ :: Employee Database - Bizarre Error With If Statement

Dec 21, 2014

I have written a program that stores employees in a database object. You can Add, hire, fire, promote, demote, and display employees. The program uses an interface, a database class, and an employee class with member functions.

The strange behavior is in my switch statement in interface.cpp. I have a '#' that represents a command line. Add and Display functions are ok, but if I hire, fire, promote or demote. It will display '##' for the next input. I ran the debugger and after hire/fire/promote/demote is called, the first if-statement goes to 'else' and I'm trying to figure out why.

Note: main() calls mainMenu() to run the program

// interface.cpp
#include <iostream>
#include "database.h"
#include "display.h"
void mainMenu() {
displayMenu();
Database* employeeDatabase = new Database();

[Code] .....

Here are the two classes...

// database.cpp
#include <iostream>
#include <vector>
#include <memory>
#include "employee.h"
#include "database.h"
using namespace std;

[Code] .....

View 6 Replies View Related

C++ :: Checkers Game - Expected A Statement Error

Dec 4, 2013

im making a checkers game but i keep getting a 'expected a statement' error on the first 2 'else's

void Initialise(){
for(int row=0; row<3; row++) {
if(int row=0<3)
//player 1 pieces
string player = "Player 1";
for(int col=0; col<8; col++)

[code]....

View 4 Replies View Related

C Sharp :: Getting Syntax Error In INSERT INTO Statement

Apr 6, 2012

if (comboBox1.Enabled == true && textBox5.Text != "")
{
OleDbConnection con = new OleDbConnection();
con.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;" + @"Data Source= c:usersmert" + @"documentsvisual studio 2010ProjectsPayrollCSWindowsFormsApplication7P ayrollDB.accdb";

[Code]....

this is my code. I am getting this error on "cmdole2" query.

error text is:

---------------------------

---------------------------
System.Data.OleDb.OleDbException (0x80040E14): Syntax error in INSERT INTO statement.
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextE rrorHandling(OleDbHResult hr)
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextF orSingleResult(tagDBPARAMS dbParams, Object& executeResult)

[Code]....

View 1 Replies View Related

C++ :: Counter-controlled While Loop?

Jan 2, 2014

The program should be print the numbers 0 through 10, along with their values doubled and tripled. The data file contains the necessary variable declarations and output statements.

Example the output:

Single Double Triple
1 2 3
2 4 6
3 6 9
4 8 12

here my code tell me if correct

#include <iostream>
#include <cstdlib>
using namespace std;
int main () {
int x, double, triple;

[Code] .....

View 1 Replies View Related

C++ :: Logical Error - Change Value Inside Void Statement

Jul 16, 2013

I've encountered a slight logical error in my code

/*
Lab06_pensionplans.cpp
Purpose :
- Create a simple financial application to calculate retirement plans
*/
#include <iostream>
#include <cstdlib>
using namespace std;
void displayMenu() {
system("cls");

[Code] ....

Look at case 2, which the user supposed to key in a new input, the problem is the value will never got into main function, I don't know what should I modify with the function.

Figured out I need to change the

void changeData(int startingAge, int numOfYears,
double lumpSumAmount, double yearlyAmount, double interestRate )

into

void changeData(int &startingAge, int &numOfYears,
double &lumpSumAmount, double &yearlyAmount, double &interestRate )

View 2 Replies View Related

C++ :: Error - Statement Cannot Resolve Address Of Overloaded Function

Nov 2, 2013

I can't seem to figure out whats causing this error: statement cannot resolve address of overloaded function . Error is before line 14 in bubblesortrand function. Thnx in advance.

void bubblesort(int num[], int a_size)
{
int i, j, temp;
for(i = (a_size - 1); i >= 0; i--)

[Code].....

View 4 Replies View Related

C++ ::  Making A Moving Item Controlled By Using WASD

Mar 21, 2013

I'm working on a personal project with a screen that looks like this:

+++++
+++++
++O++
+++++
+++++

And below that it asks where you want to move. I've done the majority of the work, I just have to figure out how to actually move the O. Here's my source code:

#include <iostream>
#include <iomanip>
#include <algorithm>
using namespace std;

[Code]....

View 2 Replies View Related

C++ :: Controlled Read And Write Rates Of Files

Jun 3, 2013

need to create a program for the following problem

1.Program takes messages as input at a rate “X” msg/sec, and outputs those messages at “Y” mgs/sec in a file.

2.The peak value of X can be 10msg/sec, and Y can be at max 5msg/sec. System should be designed in such a way that it can handle the peak input rate of 10msg/sec for not beyond 5 minutes.

3.Message contains following fields – unit id, timestamp, temperature.

4.Input data to be read from a file. Output data to be written to a file.

5.For testing design 3 types of profiles –

a.Profile 1 for 10 min – low rate, i.e. X = 4 msg/sec on an average throughout the period.
b.Profile 2 for 10 min – Max rate, i.e. X = 10 msg/sec for 2 min; then a sleep of 2 min, then repeat the same pattern till complete period
c.Profile 3 for 10 min - Max rate, i.e. X = 10 msg/sec for 5 min; then no traffic for next 5 min

View 1 Replies View Related

C++ :: Count Controlled Loop Than Can Print Char

Sep 27, 2012

Write a count controlled loop than can print "i" char. The user is supposed to input a integer and that integer is how many asterisks there is on the blade, in this case it is 5.

* *
** ** **---------------
*******
** ** **
* ** * -10 Rows high
** -blade always connects on second row of handle
**
**
**
**------------------

These are the steps he told us to do it in.

1) *
**
***
****
*****

2) *
**
***
****
*****
****
***
**
*

3) * *
** **
*** ***
**** ****
**********

4) * *
** **
*** ***
**** ****
**********
**** ****
*** ***
** **
* *

5)* *
** ** **
*******
** ** **
* ** *
**
**
**
**
**

View 4 Replies View Related

C++ :: If Statement Error - Match Text Variable That User Has Entered With Another Got From Array

Dec 3, 2014

I have an if statement that should either match a text variable that the user has entered and a another text variable that has been got from an array but they won't match even if they are the same,Im at a lost with it.

void displayQuestion(int noQuestion, string questionArray[], string answerarray[], string answer, double scorearray, double finalscore){

cout << questionArray[noQuestion] << endl;
cout << "enter an answer " << endl;
cin >> answer;

[Code] ....

View 1 Replies View Related

Visual C++ :: Game Controlled At Runtime By External Source File

Mar 24, 2013

Is it possible to create a program like Robocode, a game controlled at runtime by an external source file in visual c ++? For example create a checkers game where there would be an external source file, read at runtime, which would play automatically, with artificial intelligence. You can? If yes, how?

View 9 Replies View Related







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