Sponsored Content
Full Discussion: system("PAUSE") Problem.....
Top Forums Programming system("PAUSE") Problem..... Post 7913 by mbolthouse on Wednesday 3rd of October 2001 11:54:16 AM
Old 10-03-2001
system("PAUSE") Problem.....

Ok, here's the situation....I have this code...

#include <iostream.h>
#include <stdlib.h>

int main()
{
cout << "\nBlah, and Blah\n\n";

system("PAUSE");

return 0;
}

Now, "system("PAUSE")" gets executed before "cout" does, and I have absolutely no idea why, so when I type this in instead...

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

int main()
{
printf ("\nBlah, and Blah\n\n");

system("PAUSE");

return 0;

}

...it works just fine....it's like printf has precidence over cout, which I need to fix. So, does anyone know another way for a PAUSE using cout, and does anyone have anymore information on why this situation occurs? Thanks!

Mike
 

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

A question/problem about oracle "tns listener" and "enterprise manager"

hi, I have * an IBM P550 machine, * an AIX 5.3 running on it and * an oracle database, already installed on it. The problem (or question of my own) is: Oracle tns listener, "CT_LISTENER", and the enterprise manager (EM) of the instance, which is uniq instance and called... (0 Replies)
Discussion started by: talipk
0 Replies

2. UNIX for Advanced & Expert Users

A question/problem about oracle "tns listener" and "enterprise manager"

hi, I have a problem about the Oracle related components. I'm not able to find any answer yet, and waiting for your responses... Here is the configuration of my system: * an IBM P550 machine, * an AIX 5.3 running on it and * an oracle database, already installed on it. The problem (or... (1 Reply)
Discussion started by: talipk
1 Replies

3. Programming

Problem with socket binding - "system" call

Hi, I am having an issue with using sockets. I have a program which binds to a socket and listen on it. Later I spawn a thread to handle some function. In the new thread created I need to call a shell script which executes the specified function. Here I am using a system command to call the... (5 Replies)
Discussion started by: Janardhanbr
5 Replies

4. Programming

Problem with system("command")

Sorry, I don't speak English very well but I will try to explain my problem! If I write a C++ program and I use che system call system("command") I have this problem: If I would launch a program I do this: system("~/Agostino/program/test") and all work fine!! But if I divide this... (9 Replies)
Discussion started by: acciues
9 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

Problem using "system" command in perl

Hello!!! I'm trying to pass the output from bash command to perl variable in a perl script, and I used the "system" command to execute the bash statment and pass the result to perl string variable, in this perl script I used a variable $file that store data for using it as a regular expression.... (2 Replies)
Discussion started by: evolabo
2 Replies

7. AIX

[Tip] Problem with rpm ("different operating system")

I have once experienced this problem without understanding what caused it but now learned thatn there is even a PMR dealing with it. Sometimes it happens that you encounter the following (rather cryptical) error message when trying to install an rpm-package: package <rpm_package_name> is for a... (1 Reply)
Discussion started by: bakunin
1 Replies

8. Shell Programming and Scripting

awk "date" and "system" command

Hello experts! I need your help please I have a file.txt of which I want to extract 3rd and 4th columns with date with the form e.g.: 2016-11-25 03:14:50and pass them to "date" command, but also append the 9th column in a file as well. So I want to execute date -d '2016-11-25 03:14:50' ... (2 Replies)
Discussion started by: phaethon
2 Replies

9. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

10. UNIX for Beginners Questions & Answers

What does "force devmap reload" as in "multipath -r" means for my system and stability of my system?

Cannot present unpresented disks back again. On a test server tried this as a solution "multipath -r" and it worked. Too worried to try it in production before I know all the information. Any info would be appreciated! Also some links to the documentation on this specific issue could help a... (1 Reply)
Discussion started by: jsteppe
1 Replies
FBB::Ranger(3bobcat)						   Error handler					      FBB::Ranger(3bobcat)

NAME
FBB::Ranger - generalizes ranges for range-based for-loops SYNOPSIS
#include <bobcat/ranger> DESCRIPTION
The Ranger class template defines ranges that can be used with range-based for-loops. The standard range-based for-loop requires for its range-specificiation an array or an iterator range as offered by, e.g., containers (through their begin and end members. Ranges defined by a pair of pointers or by a subrange defined by iterator expressions cannot currently be used in combination with range-based for-loops. Ranger extends the applicability of range-based for-loops by turning pairs of pointers, an initial pointer and a pointer count, or a pair of iterators into a range that can be used by range-based for-loops. Ranger is a class template requiring one template type parameter: Iterator, an iterator or pointer type reaching the data when derefer- enced. Ranger's users don't have to specify Ranger's template type. The function template ranger returns the appropriate Ranger object. NAMESPACE
FBB All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB. FREE FUNCTION
When using the following free functions, any (subrange) of iterators or pointers can be used. With iterators subranges of reverse iterators can also be specified. The EXAMPLE section below illustrates the use of the ranger function templates. o Ranger<Iterator> ranger(Iterator &&begin, Iterator &&end): this function template returns a Ranger object for the (sub)range defined by two (reverse) iterators; o Ranger<Iterator> ranger(Iterator &&begin, size_t count): this function template returns a Ranger object for the (sub)range defined by the (reverse) iterator range begin and begin + count; o Ranger<Data *> ranger(Data *begin, Data *end): this function template returns a Ranger object for the (sub)range defined by the two pointers begin and end; o Ranger<Data *> ranger(Data *begin, size_t count): this function template returns a Ranger object for the (sub)range defined by the two pointers begin and begin + count. CONSTRUCTORS
Below, Iterator refers to the Ranger class template's type parameter. Although named 'Iterator' it can also be a pointer to some data type (e.g., std::string *). o Ranger(Iterator const &begin, Iterator const &end): A Ranger object can be passed as range-specifier in a range-based for-loop. All elements defined by the range will subsequently be visited by the range-based for-loop. The copy and move constructors are available. OVERLOADED OPERATORS
The copy and move assignment operators are available. MEMBER FUNCTIONS
o Iterator const &begin() const: returns (a copy of) the begin iterator passed to the Ranger's constructor. Note that if Iterator was a pointer type (like int *) the data to which the iterator returned by begin() can actually be modified, as the member's return type (using int * for Iterator) becomes int * const &, so a reference to a constant pointer to an int. This is perfectly OK: if the data themselves should be immutable, then the data type must be defined as int const, which is automatically the case when passing int const * data. See the EXAMPLE section for an illustration. o Iterator const &end() const: returns (a copy of) the end iterator passed to the Ranger's constructor. If reverse iterators are passed to Ranger's constructor, then the begin and end members return reverse iterators. Since the intended use of Ranger objects is to define a range for range-base for-loops, members like rbegin and rend can be omitted from Ranger. EXAMPLE
#include <vector> #include <iostream> #include <bobcat/ranger> using namespace std; using namespace FBB; int main() { vector<int> iv {1, 2, 3, 4, 5}; // display and modify a subrange for(auto &el: ranger(iv.rbegin() + 1, iv.rend() - 1)) cout << el++ << ' '; cout << ' '; // display a reversed range for(auto &el: ranger(iv.rbegin() + 1, iv.rend() - 1)) cout << el << ' '; cout << ' '; // same: display using a count for(auto &el: ranger(iv.rbegin() + 1, 3)) cout << el << ' '; cout << ' '; int intArray[] = {1, 2, 3, 4, 5}; // display and modify elements // in a pointer-based range for(auto &el: ranger(intArray + 1, intArray + 3)) cout << el++ << ' '; cout << ' '; // data now modified for(auto &el: ranger(intArray + 1, intArray + 3)) cout << el << ' '; cout << ' '; // using a count rather than an // end-pointer for(auto &el: ranger(intArray + 1, 3)) cout << el << ' '; cout << ' '; int const constInts[] = {1, 2, 3, 4, 5}; // data can't be modified for(auto &el: ranger(constInts + 1, constInts + 3)) cout << el << ' '; cout << ' '; } FILES
bobcat/ranger - defines the class interface SEE ALSO
bobcat(7) BUGS
None Reported. DISTRIBUTION FILES
o bobcat_3.01.00-x.dsc: detached signature; o bobcat_3.01.00-x.tar.gz: source archive; o bobcat_3.01.00-x_i386.changes: change log; o libbobcat1_3.01.00-x_*.deb: debian package holding the libraries; o libbobcat1-dev_3.01.00-x_*.deb: debian package holding the libraries, headers and manual pages; o http://sourceforge.net/projects/bobcat: public archive location; BOBCAT
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'. COPYRIGHT
This is free software, distributed under the terms of the GNU General Public License (GPL). AUTHOR
Frank B. Brokken (f.b.brokken@rug.nl). libbobcat1-dev_3.01.00-x.tar.gz 2005-2012 FBB::Ranger(3bobcat)
All times are GMT -4. The time now is 07:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy