C :: How To Get Output Of Program

Dec 8, 2013

how to get the output of this program.. I'm not completely lost but I need it in the simplest terms.

Code:

/*Recursive Trace
Written by Ron
April 2006
*/

[Code]....

View 9 Replies


ADVERTISEMENT

C :: Program To Output PPM File

Oct 8, 2014

How do you make a program output a ppm file?

Code:
#include <stdio.h>
void make_pixel
(
int r, // red intensity

[Code].....

View 7 Replies View Related

C++ :: Program Flashes - Cannot See Output

Jul 22, 2014

Why is it that the program doesn't stop for me to see the output? Here is my code:

// accessing mapped values
#include <iostream>
#include <map>
#include <string>
using namespace std;
int main () {
char str[] = "This table is a good table, while this book is a good book.There is an umbrella on the table";
int n = strlen( str );

[Code] .....

View 1 Replies View Related

C++ :: Program To Output Name From A File

Dec 10, 2014

I am trying to get my program to output the name from a file. The user should enter first name "or" last name. and if the user does not type the name from the input file. the get an error message. How do you do it

#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
using namespace std;

const int NUM_STUDENTS = 17;
const int NUM_QUIZZES = 10;
const int NUM_EXAMS = 5;

[Code] ....

View 4 Replies View Related

C/C++ :: Slow Down Program Output?

Apr 1, 2014

Is there a good way to slow down program output? usleep and nanosleep don't slow it down enough, delay doesn't work, and sleep keeps freezing my program. I am using Linux since I think this makes a difference in what I have to use.

View 9 Replies View Related

C :: Program Console Output Being Interrupted

Mar 6, 2015

I am wrapping up a Linux/C programming assignment that requires several small programs for encrypting and decrypting text. There is a bash grading script which will be used to assess the performance of my programs. The script runs fine on my local machine and all of my tests pass, but when I run everything on my University's server via SSH, the script is not behaving the same. I am fairly certain the error exists somewhere in my C code, because no other students are having this issue. The 4 main programs consist of 2 daemons which wait for clients to connect via sockets, and the two clients. There is a daemon/client pair for handling encryption, and another for handling decryption.

And here is a screenshot of what happens with the same files on the remote server:As you can see, in the 4th and 5th tests (where the program's output should read), it's instead showing "ssIgnore this message". In later tests (not pictured) there is another message that reads "ddServer to client message". This text appears nowhere in my code or the grading script, so it must be server-side.

View 1 Replies View Related

C :: Saving Output Of Program As TXT File

Feb 21, 2015

My project involves writing a c program to generate a set of 70 decimal numbers. I want to save the output (these 70 numbers) as a txt file. I tried the following:

1. prt scr of output screen and pasting it in notepad. NOT WORKING
2. going to DOS SHELL and doing the following:
c:TCBIN>output.exe>>output.txt
NOT WORKING. Text file is generated, but it does not contain output. It just says:
illegal command: output.exe

What do I do?

View 2 Replies View Related

C++ :: How To Output File Into New Program Or Code

Apr 24, 2013

//code
ofstream outFile;
outFile.open("p4a.dat");
outFile << setw(8) << "90.0";
outFile << setw(8) << "75.0";
outFile << setw(8) << "36" << endl;

[Code] .....

View 1 Replies View Related

C++ :: Writing Output Of A Program To A File?

Mar 27, 2013

basic code for writing output of a program to a file? I can't seem to find it online and I need it to complete a project.

View 2 Replies View Related

C++ :: Program That Reads In Ten Whole Numbers And Output Sum

Jan 23, 2014

Write a program that reads in ten whole numbers and that output the sum of all the numbers greater than zero, the sum of all the numbers less than zero (which will be a negative number or zero), and the sum of all the numbers, whether positive, negative, or zero. The user enters the ten numbers just once each and the user can enter them in any order.

Your program should not ask the user to enter the positive numbers and the negative numbers separately. Assume the user will type integer numbers.

this is what i got but it wont run saying there is an error

#include<iostream>;
using namespace std;
int main() {
int count=0;
int num;
int positive=0;
int negative=0;

[Code] ....

View 5 Replies View Related

C++ :: Program Won't Output Any Information To Text File

May 6, 2013

my program wont output any information to the text file that I have specified it just creates it but it leaves it blank

#include <iostream>
#include<string>
#include<iomanip>
#include <fstream>
using namespace std;
class Carloan

[code]....

View 2 Replies View Related

C++ :: Program To Output A Check With Correct Spacing

Oct 14, 2013

So I have to write a program that outputs a check with correct spacing and everything.

Create a project titled Lab7_Check. Write a program that asks the user the check information and prints the check. The dialog should be as follows:

date: 2/23/2010
name: William Schmidt
amount, dollars: 23
cents: 30
payee: Office Max

your check:

William Schmidt 10/13/2013
pay to: Office Max $23.30
twenty three and 30/100 dollars

You may assume that a person always has the first name and last name (no middle names or initials). The payee name is also always two words. The dollar and cent amount are integers and the amount is always less than 100 dollars. Note that the dollar amount could be zero, in which case, when you spell the dollar amount, it should print "zero". The date is always a single (non-white space separated string). Your date, dollar amount in numbers and the word "dollars" have to vertically align.

This is the code I have so far.

#include <iostream>
#include <string>
using namespace std;
int main(){
string date;
string firstname;
string lastname;

[Code] .....

View 3 Replies View Related

C++ :: Cumulative GPA - Program Fails To Display Output

Dec 9, 2013

How do i display the output ? This program only saves the output to "gpa.txt" I want it to also display the output to cmd.

#include <iostream>
#include <iomanip>
#include <fstream>
#include <cmath>
#include <string>
using namespace std;
const int SIZE = 10;

[Code] ....

View 1 Replies View Related

C/C++ :: Output Of Program Shows Unknown Character When It Run

Mar 20, 2014

#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
float CalcPriceMember1(int,float&,int&);
float CalcPriceMember2(int,float&,int&);
float CalcPriceNonMember1(int,float&,int&);
float CalcPriceNonMember2(int,float&,int&);

[code].....

View 8 Replies View Related

C/C++ :: Can't Get Basic Input / Output Program To Work

Feb 29, 2012

im trying to write a program that prompts the user to enter three numbers and then prints them vertically (each on one line), first forward and then reversed. this is how the design should look:

enter three numbers: 1 43 54

your numbers fowards:

1
43
54

your numbers backwards:

54
43
1

this is what i have thus far when it comes to code....
   
#include <stdio>  
int main (void) {
// local declarations 
int a;
int b;
int c

[code].....

View 1 Replies View Related

Visual C++ :: Program That Reformat And Output Date

May 30, 2013

Write a well-commented C++ program that reformats and outputs the date. Prompt the user to input the date in the format dd/mm/yyyy and outputs it in this format month, dd, yyyy. For example, 07/06/2012 is displayed as June 07, 2012. You are provided with the file months.txt containing the months and their corresponding numbers, for example 01January 02February etc. Use getline(monthsFile,monthString) to read in a string from the file, and use the monthString.find() function to search for the number and extract the corresponding month.

-confused by the way she told me to use getline(monthsFile,monthString) => if I just do it like this I only get the first line from the txt file (01January)
-if I try putting all the months on one line in the txt file (which i'm not even sure i'm allowed to do), I'm not sure what to do for the length of my substring output. if I make it long enough to fit longer months like September, someone entering may gets both may and june in the output
-if I input all the months into separate variables, I'm not sure how to make it only output the month entered by the user

the months.txt file is as follows:

01January
02February
03March
04April
05May
06June
07July
08August
09September
10October
11Novmber
12December

View 1 Replies View Related

C++ :: Redirect Shell Standard Output Into Program Stream?

Oct 4, 2013

I want to take the standard output of a shell command (in Red Hat, using tcsh, in my case) and redirect it into my program for processing.

(Then ideally I would love to take the output of my program and redirect it to yet another command, but this is a second issue.) Simple example: I naively thought this might work:

I want to type this on the shell:

Code: $ echo Harry > hello and I was expecting this output on my terminal:
Code: $ hello, Harry And this would be my simple hello program:
Code: #include <iostream>
#include <string>
int main() {
std::string usrInput;
std::cin >> usrInput;
std::cout << "hello, " << usrInput << std::endl;
return 0;
}

View 3 Replies View Related

C++ :: Program That Prints Prime Factors Needs To Have Them Output In A Specific Way

Jan 6, 2015

I am working on an assignment to enter a number and print all the prime factors of that number. I have that working, but the assignment demands the output be formatted in a strange way which I can't figure out. For example, in my current program entering 10 gets me 25, which is actually 2 and 5. But it should get me: ( 2 * 5 ) but I can't figure out how to do this. On the chance you need it, my code is below:

Code:

#include <iostream>
using namespace std;
int main( )
{
cout << "Number: ";

[Code].....

View 12 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 :: How To Print Out Output String For A Program In Reverse / Backwards

Feb 20, 2013

How to make it so an output for a program would print out the string in reverse/backwards? I was just curious on how to do this.

View 6 Replies View Related

C++ :: Static Variable Initialization - Console Output Of Program

Oct 11, 2013

What does the order of console output from your program tell you about when the static object is initialized?

#include <iostream>
using namespace std;

//class
class Firstclass {
private:

Firstclass(); //constructor
~Firstclass(); //destructor

[Code] ....

Doesn't it allocate the class static variable to the heap, thus executing its algorithm then destroying it when the program ends - or. What exactly does it tell me? When the static variable is initialized, it takes place first before any of my other functions?

View 7 Replies View Related

C++ :: Program To Check If Phrase Is In File And Output The Result

Jun 6, 2013

I wrote a program that should check if phrase is in file and output the result.

File:
//////////////
Eat my shorts!
Ay Carumba!
Stupid Flanders...
////////

Why my program doesn't cout?

#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <fstream>
using namespace std;
string checkData (char Input[], char dataB [], int nMAX){

[Code] .....

View 2 Replies View Related

C++ :: Program Output That Doesn't Wait For Replies But Still Captures Them

Jul 21, 2013

I am trying to write a program that can communicate over a very latent internet connection involving a cellular modem. I have some software packages that handle all the telnet like business and will pipe stdout and stdin to a program I can have it execute.

The problem I am running into is that I have to send about 900 ASCII commands to an instrument to request data but it takes about a second between when a command goes out and when a reply comes back. This will wind up taking a very long time and I am looking to speed it up. All of the commands are independent of the reply so what I need to do is create a program that can send all 900 commands with maybe 10ms break between them and to not wait for a reply. It then needs to read the replies and write them straight to a file.

It seems like this should be achievable in C++ but I only have a very basic understanding of the language and thus am not sure where to start.

I am open to using other languages but thought C++ would be a reasonably good start so I can distribute the program to my coworkers. All of our work machines are Windows but if there is a simpler solution from Linux, I should be able to work something out. I'm just trying to avoid complication.

View 5 Replies View Related

C/C++ :: Program To Allow User Input And Output Perfect Number

Mar 11, 2014

The problem that I am having is that , the program outputs numbers that are perfect numbers and im not sure where i can add a statement to make it so that if it isn't a perfect number it doesn't output...

#include<iostream>// allows user input/output
#include<conio.h>
#include<fstream>//data file / result file
#include<iomanip>
#include<cmath> // math function
#define in_file "data.txt"
#define out_file "result.txt"

[Code] ....

View 3 Replies View Related

C++ :: Construct A Program Without Main Function That Output Stars

Nov 5, 2013

I am trying to construct a program without a main function that outputs stars but at the same time outputs the number and a colon after the number but before the number of star. This is the coding i have so far.

void output_stars(int num){
if (num > 0){
cout << "*";
output_stars(num-1)

[Code] ....

The program is working the way it should i just can't figure out how to output the number and a colon. The main function is written as such:

output_stars(1);
output_stars(2);
output_stars(5);
output_stars(3);
output_stars(4);
output_stars(7);

How to get the numbers of the main function to show up with the stars of the previous function.

View 6 Replies View Related

C/C++ :: Incorrect Output From Unsigned Binary To Decimal Program

Feb 2, 2015

This program has to convert an unsigned binary number into a decimal number. No matter what binary number I enter, however, it always outputs that the decimal number is 0.

My code is as follows:

#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main() {
string binarynumber;
cout << "Enter an unsigned binary number up to 32 bits." << endl;

[Code] ....

And my output:

Enter an unsigned binary number up to 32 bits.
00001111
That number in decimal is 0

The output should have shown the binary number in decimal to be 15, and I cannot find my error.

View 6 Replies View Related







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