C++ :: Keeping Output Window Open

Jun 24, 2014

My program accepts strings, places them in a vector and then "bleeps!" out words of my choosing, in this case, "broccoli". But I'm having trouble keeping the output window open even with my Keep_window_open() implementation.

#include "iostream"
#include "string"
#include "vector"
#include "algorithm"
#include "cmath"
using namespace std;

[code]....

View 2 Replies


ADVERTISEMENT

C/C++ :: Keeping List Of User Guesses And Output Message If Guess Is Duplicate

Apr 19, 2015

The label "You already picked that" doesn't always appear. Sometimes it does, but only if a duplicate has been entered at least 3 times. I haven't been able to correct this. I am new to programming and array-based lists.

//Objective: randomly generate an integer between 1 and 100, input user guess as to what number it is, and output "correct!" if user guess is the random number, or output "Too high" if the user guess is too high, or output "too low" if the user guess is too low, "you already entered __" if a duplicate is entered and allow the user to keep guessing until they guess the correct number

//libraries
#include <ctime>
#include <cstdlib>
#include <iomanip>
#include <iostream>
using namespace std;
struct Guess {

[Code] ....

View 9 Replies View Related

C++ :: How To Open A Window Maximized

Apr 28, 2014

There is only one thing I need here. When the paint program is opened I need it to automatically open it maximized. Other than that my code works perfectly for what I'm trying to build.

It has to be maximized so when a friend opens it after I send it to him, it auto maximizes and doesn't start drawing on his desktop.

#include <iostream>
#include <Windows.h>
using namespace std;
int main() {
system("start C:/Windows/System32/mspaint.exe");
FreeConsole();
Sleep(1000);

[Code] .....

View 3 Replies View Related

C++ :: How To Make CMD Window Pop Up When Open A Game

Dec 20, 2014

I wanna know how to do so a cmd window when you open a game.

Example: when I start cheese attack (just a name I like) then a cmd window come up, how do I do that?

View 1 Replies View Related

C# :: How To Select Open Application Window

Feb 10, 2015

this is my app interface as in attachment when i click an arrow it split the current selected window in arrow direction.

i want to know how to pass the current window to my button... i tried it using

Process[] processlist = Process.GetProcesses();

but it wont works

View 3 Replies View Related

C++ :: How To Open Command Window At The Folder Containing EXE File

May 26, 2013

This is the code

#include <iostream>
using std::cout;
using std::endl;
int main(int argc, char* argv[])

[Code] ...

The only Problem I have is that I need to know how to open a command window at the folder containing the .exe file(this program), inorder to enter the program name or arguments.

View 2 Replies View Related

C# :: How To Create A Window Where User Can Open A File

Dec 15, 2014

I am using

string text = System.IO.File.ReadAllText(@"C:datainput.txt");

to open a file and save it content to "text"

How can I instead create new window where user will select the .txt file he wants to read like many applications do

This is a WPF application

View 10 Replies View Related

C# :: Open WPF Window From Double Click On Selected Item In A List?

Apr 23, 2015

I have a list with 2 items in it. When I double click on item 1, I want to open Window1.xaml, when I double click on item 2, I want to open Window2.xaml...

The code below works for popping up a message box, or window for that matter. But I really need to get the Window1 and Window2 based on the clicking of the correct selected item in the list.

Here is some code:

<ListView d:DataContext="{d:DesignData }" Name="PharmacyLv" IsSynchronizedWithCurrentItem="True" l:Sortbehavior.CanUserSortColumns="true" >
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<EventSetter Event="MouseDoubleClick" Handler="ListViewItem_PharmDoubleClick" />
</Style>
</ListView.ItemContainerStyle>

[code].....

View 3 Replies View Related

C++ :: Absolute Path Reference - Open File And Print Contents To Terminal Window

May 12, 2014

I am trying to open a file and print the contents of the file to the terminal window. It works when I put the file right in the directory with the Solution but not if the file is out on my desktop and I use the full path. Here is the code:

#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int OpenFile(){
fstream SampleFile;

[Code] .....

View 5 Replies View Related

C++ :: Clearing Cin Buffer - Output Window

Jul 10, 2014

I am having some issue with clearing cin buffer. The following code does not wait for me to see the output window and till I hit return character.

#include "iostream"
#include "stdio.h"
#include "math.h"
#include "string"
#include "sstream"
using namespace std;

[Code] ....

I tried
cin.flush, cin.ignore(numeric_limits<streamsize>::max(), '
'); cin.clear(); fflush(stdin);.
None of them worked

I am working on Microsoft visual studio express 2013 for windows desktop.

View 3 Replies View Related

C++ :: Stop Cursor From Blinking In Output Window?

Oct 2, 2013

is there a way to stop the cursor from blinking in the output window(or showing up at all)?

Example:
cout<<"Hello world";

Output:
Hello world_

//where last character keeps blinking

I use DevC++ in Windows 7.

View 3 Replies View Related

C/C++ :: Command Prompt Window Disappears Before Output?

Jan 14, 2013

this is my program, it works fine when asking for inputs, but as soon as i press enter for the output the window just dissapers.

#include<stdio.h>
main()
{int bno;

[Code].....

View 2 Replies View Related

Visual C++ :: Dump Information To Console Or Output Window?

Feb 6, 2014

I used to use OutputDebugString, and not using it now because it only allows to strings to be outputted, are there any methods that I can dump virtually anything to the console?

cout << thing << endl;

But what if I am not start running the program from the command prompt?

View 2 Replies View Related

C++ :: Program To Stay Open Until Press Enter Even After Whole Output

Oct 10, 2013

My program closes after the out even though i've used cin.get():

I want the program to stay open at least until you press enter, even after the whole output.

Code:
#include <iostream>#include <string>
int main()
{
std::cout << "Please enter your name";
std::string name;
std::cin>> name;
// build the message that we intend to write

[Code] .....

View 4 Replies View Related

C++ :: Keeping A Listbox Loaded During Startup?

Jan 17, 2013

how is it done?

ex. mp3player keeps songs loaded

View 1 Replies View Related

C++ :: Structures - Keeping High Scores Of Users

Jun 1, 2013

Write a program that allows a user to enter high scores of a game, keeping tracking of the name of the user and the score. Add the ability to show the highest score for each user, all scores for a particular user, all scores from all users, and the list of users.

This is the program I am trying to write, however I am having difficulty storing the users name and high score, I know I need to store an array for the score but getting confused because of the structure. (By the way I have to use structures as it is a problem from the structures chapter of the ebook I am doing). Below is my code so far. .

Code:

#include <iostream>
#include <string>
using namespace std;
struct highScore
{
string user;
int score;
int highestScore;
int allScores;

[Code]...

View 9 Replies View Related

C/C++ :: Dice Rolling - Keeping Track Of How Many Times A Number Appears?

Sep 27, 2014

I wrote a code that mimics a dice, my code so far will ask for the user to input a number at which they want to hold or no longer throw the dice, it will also ask the user how many roll simulations they would like to do.

If a 1 is rolled the turn is over and the score is 0

After this input is recieved the code goes into a loop until the values have been met.

I would to add probability to my code so I need to know how many times a certain number was rolled and this is where I am stuck.

An example of how I would like my code to work, let's suppose hold at number is 17

We role the dice until we roll a 17 or larger, but if we roll a 1, then our score is 0.

Let's suppose the number of simulations is 5 and for simulation 1 we roll

2 + 5 + 6 + 4 = 17

and for simulation 2 we roll

5 + 4 + 1, but since we rolled a 1, the score is 0,

for simulation 3 we roll

3 + 4 + 5 + 6 = 18

for simulation 4 we roll

4 + 4 + 6 + 6 = 20

for simulation 5 we roll

3 + 4 + 5 + 5 = 17 so that means we got

0: 1 time 1/5 = .20
17: 2 times 2/5 = .40
18: 1 time 1/5 = .20
19: 0 times 0/5 = .00
20: 1 time 1/5 = .20
21: 0 times 0/5 = .00
22: 0 times 0/5 = .00

In other words the idea is to roll a 17 or larger (or whatever the hold number happens to be), but if you roll a 1, then your score is a 0.

#include <iostream>
#include <cstdlib>
#include <ctime>
using std::cout;
using std::cin;
using std::endl;
int dieRoll();

[Code] ....

View 4 Replies View Related

C++ :: SDL Window Centering?

Jul 20, 2013

I am trying to do two things that i have an issue with finding on google. the first is im trying to center the main window, but i cant figure out how to do it. secondly i want to make it full screen but the flag for setvideomode doesnt work. is there another way?

View 1 Replies View Related

C++ :: How To Make A Window Always On Top

May 11, 2013

I want to make a window tgat stays always on top like that of a cybercafe software. A window that cannot be closed, minimised, deactivated, etc... with wxWidgets.

So far I've tried making a frame window with the wxSTAY_ON_TOP flag. It works, but not to perfection because, when i press the windows button, the start menu interferes with the window(and taskbar too). Also, the task manager, how to deactivate it.

- a wjndow that strictly stays on top

- deactivate task manager

View 3 Replies View Related

C/C++ :: Make A Window?

Oct 15, 2014

how to make a window in C++? I am trying to make a program that has a boot screen but I want it to be in its own window because it will have it's own pictures in it and text inside too. So not in a terminal but inside a external window.

View 1 Replies View Related

C :: Scanf Is Skipped In Run Window

Jul 11, 2014

when i run it , it skips scanf and not allowing user to enter input.tried adding getchar(), fflush but nothing worked for me.
//file name : sort_array_of_structure.c

Code:

/*Write a program to accept records of the different states using array of structures. The structure should contain char state, population, literacy rate, and income. Display the state whose literacy rate is highest and whose income is highest.*/

#include <stdio.h>
#define M 50
struct state
{
char name[50];
long int population;
float literacyRate;
float income;
}

[code]....

View 3 Replies View Related

C++ :: Blinking Window In SFML

May 16, 2013

using SFML in visual studio 2012 ... this code gives blinking window.

#include<iostream>
#include<SFMLGraphics.hpp>
using namespace std;
sf::RenderWindow window (sf::VideoMode(800,600),"GAME");

[Code]....

View 8 Replies View Related

C++ :: How To Set Console Window Size

Oct 28, 2013

Can I make my c++ application to open in a specific sized console window. I want to open my project in n a bigger screen so that all my output is visible. is there any way to do this...

View 6 Replies View Related

C++ :: SDL Window Image Flickers?

Sep 5, 2013

I've encountered a problem, whenever I debug the project, the window shown flickers with the image I'm trying to render and it doesn't respond (shows the loading cursor symbol) also the console window doesn't even open at all, Here's the code:

#include <iostream>
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_mixer.h>
using namespace std;
int main(int argc, char** argv){
cout<<"HI!!!!"<<endl;
system("pause");

[code]....

View 7 Replies View Related

C/C++ :: Get Window Title Text

Aug 16, 2014

I don't know how to get window title text of same process without setting a foreground window.

My code:

Using it, I get window handle.

struct handle_data {
unsigned long process_id;
HWND best_handle;
};
BOOL is_main_window(HWND handle) {
return GetWindow(handle, GW_OWNER) == (HWND)0 && IsWindowVisible(handle);

[Code] ....

This part doesn't work unless I use it with GetForegroundWindow(). But before using it, I have to set it. Is there any way to get window name without setting a foreground window?

unsigned long id = GetCurrentProcessId();
//HANDLE h = GetCurrentProcess();
HWND wind = find_main_window(id);
char window_title[256];
GetWindowText(wind, window_title, 256);
std::string txtt(window_title);

View 4 Replies View Related

C# :: WPF Window Close Button

Dec 10, 2014

I've been doing some looking and this example seems like the common way to remove the close button on a wpf window. Other than catching the on_click event or using that example, is there no better way to disable/remove that button?

View 2 Replies View Related







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