C :: Queue Program Not Running After Pressing 1

Apr 20, 2013

Code:

#include<stdio.h>
#include<process.h>
struct que

[Code].....

View 1 Replies


ADVERTISEMENT

C++ :: End Program By Pressing Enter Key?

Feb 11, 2014

I'm trying to end my program when the user presses the enter/return key.

I'm trying to do this with a break statement.

I have two different situations, one when it is a string, and the other one when it is a char.

for (int i = 0; i < 80; ++i)
{
string s;
cin >> s;
if (s == "
")
break;
S.PushStack(s);
}

I'm doing the same thing for char just replacing string with char.

I'm not sure what I am doing wrong but pressing enter does not end the program.

View 3 Replies View Related

C++ :: Write Program Where User Will Keep Entering Data Until Pressing Ctrl D

Mar 1, 2013

I'm trying to write a program where the user will keep entering data until pressing control + D. Then the it will display the mean, smallest number, and largest number.

Here are three samples of my program running.

Sample 1
Enter the price for stock 1: $ 10
Enter the price for stock 2: $ 1.555
Enter the price for stock 3: $ 3.648

[Code].....

As you can see in Sample 1, the program runs correctly. The largest number was 20 and the lowest number was 1.555. But in Sample 2, the program shows min as 15.500, where it should be showing 15.000 and Sample 3, the program shows min as 110.000 when it should be showing 55.564.

Here's the code.

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

[Code].....

View 5 Replies View Related

C++ :: Increase Sizes Of Queue In A Vector Of Queues And Find Shortest Queue

Feb 20, 2013

I have a paradigm in a loop of queues of a vector,if a condition is true,increase sizes of the queue of that particular queue in the loop of queues, if condition is false, the queuesize is left as such in loop of queues. After this operation i need to search the queue sizes of all queues and enqueue in the shortest queue.

I want to do something like the code given below

#include <vector>
#include <queue>
int min_index = 0;
std::vector<std::queue<int> > q
std::size_t size = q.size();

[Code] ....

How to implement this logic?

will q[i].size=q[i].size+5 increase the queuesize by 5 for the ith queue?

View 12 Replies View Related

C# :: Using A Modified List Queue In A Program?

Apr 22, 2014

I have uploaded the entire project file.

you just need to open the prac 4 project file.

Now I have answered the prac question by adding a new add method. and a getPriority method.

All the other code was skeleton code and i was told it should work flawlessly.But it does not.

View 3 Replies View Related

C++ :: Running A Program Outside IDE

Jul 23, 2014

after you have compiled a program can you run it without an IDE?

View 17 Replies View Related

C++ :: Checking If A Program Is Running?

Jun 17, 2014

I have a question, how can I check if a program is running using c++? For example

if (notepad.exe is running) {
.... ..... ....

View 3 Replies View Related

C++ :: Running A SLR Parser Program?

Apr 27, 2012

I need to run a program that makes a SLR Parser Table.

Here is the code :

Code to find first and follow:

saved as SLR.h
#include<stdio.h>
#include<ctype.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream.h>
#define epsilon '^'

since I didn't know how to type epsilon symbol temporarily I am using ^

char prod[20][20],T[20],NT[20],c[10][10],foll[10][10],fir[10][10];
int tt,tnt,tp,a;
int follow[20][20],first[20][20];
void first_of(char);
int count(int j);
void rhs(int j);

[code]....

View 3 Replies View Related

C/C++ :: Program Is Running But It Won't Stop Compiling

Nov 20, 2014

#include <iostream>
using namespace std;
int main() {

[Code].....

View 2 Replies View Related

Visual C++ :: Running GUI Program In Background?

Apr 22, 2013

i created a windows service that will run another program. but the program i want to run has a gui and i don't want the gui to be visible, i just want the program to run in the background.

But i have to do it without editing the gui program

here's my code:

Code:
TCHAR* path = L"C:Myfile est.exe";
STARTUPINFO info = {0};
PROCESS_INFORMATION processInfo;
ZeroMemory( &info, sizeof(info) );
info.cb = sizeof(info);

[code]....

i tested this code with notepad and it runs notepad in the background without displaying the window but when i try run my program it doesn't work. i don't know why its works for one program and not the other..

View 14 Replies View Related

C++ :: Dynamically Resizing Array While Program Is Running?

Feb 4, 2015

I'm working the 4th problem in chapter 14 of the Jumping into C++ book. In the book, he gives an example program for dynamically resizing an array while the program is running. It works fine for integer types but i need to do the same with a string type array. Right now my program is crashing because the string array is not resizing itself. Here's the part of the code im trying to figure out. The part for the int array has been ignored using // since it works fine and I'm trying to figure out whats wrong with the string array.

Code:
#include <iostream>
#include <string>
//Write a program that lets users keep track of the last time they talked to each of their friends.
//Users should be able to add new friends (as many as they want!) and store the number of days ago

[Code]......

View 8 Replies View Related

C :: Program Compiles Fine But Seg Faults While Running

Dec 1, 2013

So i compile fine, but when i run my program, after the printf it just segfaults (core dumped)...

Code:
#include<stdio.h>#include<string.h>
#include<stdlib.h>
void main() {
unsigned int j=0, max=9;
char num[100] , str1[100], str2[max];
FILE *fp;

[Code] .....

View 4 Replies View Related

C :: Simple File And String Program Not Running

Mar 6, 2015

The assignment is to write a program that statistically computes similarity of C syntax with another program; a same and a different. The one used here is in C language, it's called Battleship.cpp. The program must open a file and read line by line for keywords and then produce statistics. The reason my code is not running is the fopen function is failing and it goes to return -1. I am using MS Visual Studio 2013 and there are no compiler errors after turning off deprecation. I do see, however, this error UMEngx86.dll'. Cannot find or open the PDB file. The file being opened is in my source folder.

Code:
1
2
3
4
5
[code]....

View 4 Replies View Related

C++ :: Setting Background Color And Running A Program

Feb 1, 2013

I use turbo c++ 3.0

How to set the background color using the function setbkcolor() in graphics.h

will i need to run the exe file in full screen if i use this function?

View 4 Replies View Related

C/C++ :: Full Menu Not Shown When Running Program

Mar 4, 2014

The program is not showing my full menu just the 0 Exit and the last line of text. This is the full main source file (not implementation file or header file).

#include <iostream>
#include <string>
#include <fstream>
#include <iomanip>
#include <vector>
using namespace std;
struct menuItem{
string itemDesc;
double price;
int menuType;

[Code] .....

View 3 Replies View Related

C :: Program To Simulate Taxi Rank Implemented As Queue Via Array - Linked List

Mar 26, 2013

I have an assignment where i am required to code up in C, a program to simulate a taxi rank that is implemented as a queue via an array that can hold up to a maximum of six taxis.When a taxi arrives, it joins the rear of the queue. When a taxi departs, the first taxi in the rank is used and its departure is logged.A "rolling menu" comprising integer codes as specified below is used until 0 is entered to exit the simulation. I've done this stage but now the next stage is asking me to implement the queue as a linked list. what the difference is between an array and a linked list and what is a linked list?

View 2 Replies View Related

C++ :: Destructor And Inheritance Causing Program To Crash After Running?

Dec 13, 2013

I have a class which dynamically allocates memory for three data arrays, and as such in the destructor I told it to delete those data arrays.

However, when I've created a new class, and inherited the previous class - it will always crash AFTER running the program, unless I don't have the previous destructor present.

View 3 Replies View Related

C/C++ :: Check Printing Program Breaks Halfway Through Running

Apr 3, 2015

For my c++ we're suppose to write a program that prints out a check. It's suppose to translate the numeric value of the dollars to worded strings.

Header File:

#ifndef CHECKWRITING_H
#define CHECKWRITING_H
#include <string>

[Code]....

View 1 Replies View Related

C++ :: Running Infix To Postfix Stack Conversion Program

Mar 27, 2014

I keep getting the same error messages every time on Visual Studio. I don't know where the error is originating. Basically I'm trying to convert an infix expression (A+B-C) to a postfix expression (AB+C-) using stacks.

#include <iostream>
#include <fstream>
#include <string>
#include <stack>
#include "Expression.h"
#include "stackType.h"
using namespace std;
int main() {
string fileName;
string infixExpression, postfixExpression;

[Code] .....

View 2 Replies View Related

Visual C++ :: Command Prompt - Running GUI Program In Background?

May 2, 2013

No I definitely used Visual Studio Command Prompt

c:Program FilesMicrosoft Visual Studio 9.0VC
un_process_from_service>make.bat

View 7 Replies View Related

C :: Program To Check For Running Pid Using System Call In UNIX / Linux

Dec 11, 2013

I have written a program which uses a pid to check if the process is currently running and return a value based on the system call result.But the program core dumps

Code:

#include <stdio.h>
#include <string.h
int main( argc, argv )
int argc;
char * argv[];
{
int p_pid = 99;
char buff[1000];
}

[code]....

What is the mistake in this code and is it portable in both unix/linux , is the method secure (grepping for program name )?

View 6 Replies View Related

C :: Reversing Every K Nodes Of Linked List - Program Crashes While Running

Mar 11, 2013

The code below is for reversing every k nodes of the linked list. While running the Program it crashes.

Code:
#include<stdio.h>
#include<stdlib.h>
struct node {
int info;
struct node *next;

[Code] ....

View 1 Replies View Related

C++ :: How To Allow Pressing Some Keys On Keyboard

Jul 4, 2014

how can I allow pressing some keys on the keyboard in C++? I mean, when you are in the console and you are only allowed to press numbers before pressing enter, for example.

View 6 Replies View Related

C++ :: Stop Infinite Loop By Pressing Enter

Apr 12, 2014

I wondering how to stop a infinite loop. The program clears a file then opens it and refreshes it over and over(the file is going to be modified by another program). I want it to start from the beginning anytime i press enter or escape, it doesn't really matter as long as you can restart it.

Here is the complete code:

#include <cstdlib>
#include <iostream>
#include <fstream>
#include <conio.h>
#include <windows.h>
using namespace std;
void x() {Sleep(1000);}

[Code] .....

View 2 Replies View Related

C/C++ :: Change Background Color After Pressing A Key (Graphics)

Aug 5, 2013

Here is my code:

#include <graphics.h> 
#include <stdio.h>
#include <conio.h>  
int main()  {
    int gdriver = DETECT, gmode, errorcode,i;
initgraph(&gdriver, &gmode, "c:cgi");
errorcode = graphresult();

[Code] ....

View 1 Replies View Related

C Sharp :: To Get Child Window Of MDI Page In Focus On Pressing ALT TAB

Dec 7, 2012

I have MDI form which contains mutliple tabs and each tab has its own child form . When user presses ALT TAB from the from to other application its fine but when users presses ALT TAB back to my application it should keep focus on child form last time it was selected.

View 1 Replies View Related







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