Sponsored Content
Full Discussion: C++ cin problem
Top Forums Programming C++ cin problem Post 302192573 by apprentice on Wednesday 7th of May 2008 09:25:51 AM
Old 05-07-2008
Hi, thanks!
What is the problem with g++ on Unix then?
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

SSH Problem auth problem

Hi, Just recently we seem to be getting the following error message relating to SSH when we run the UNIX script in background mode: warning: You have no controlling tty. Cannot read confirmation.^M warning: Authentication failed.^M Disconnected; key exchange or algorithm negotiation... (1 Reply)
Discussion started by: budrito
1 Replies

2. Programming

How to Get Timed Input using cin

Hi, I am trying to get the input like option from the user using cin but if the user is not responding for some time I want to use the default value which does not need users interaction can any one help to do this in unix c++? int main() { char sex = 'M' ; cout << "Are you... (5 Replies)
Discussion started by: uxbala
5 Replies

3. Shell Programming and Scripting

ssh script problem problem

Hi Please help me with the following problem with my script. The following block of code is not repeating in the while loop and exiting after searching for first message. input_file ========== host001-01 host001-02 2008-07-23 13:02:04,651 ConnectionFactory - Setting session state... (2 Replies)
Discussion started by: pcjandyala
2 Replies

4. AIX

user login problem & Files listing problem.

1) when user login to the server the session got colosed. How will resolve? 2) While firing the command ls -l we are not able to see the any files in the director. but over all view the file system using the command df -g it is showing 91% used. what will be the problem? Thanks in advance. (1 Reply)
Discussion started by: pernasivam
1 Replies

5. Red Hat

Mail Problem. Maybe, it is a DNS Problem!

Hi, i've a redhat linux 9 upadated by redhat from 7 version to 9 version. A couple of days ago i was a problem with my mail, in other words i'm not able to get any email nor to send any email. I've a proxy configuration and i tried to set iptables in order to verify the port. The 110,255 and 995... (1 Reply)
Discussion started by: pintalgi
1 Replies

6. UNIX for Dummies Questions & Answers

DHCP problem and eth1 problem

At work I am trying to get this one Linux machine (let's call it ctesgm07) to behave like another Linux machine that we have (let's call it test007). test007 returns the following version info: cat /etc/debian_version: lenny/sid uname -a: Linux test007 2.6.27-7-generic #1 SMP Tue Nov 4... (0 Replies)
Discussion started by: sllinux
0 Replies

7. IP Networking

Problem with forwarding emails (SPF problem)

Hi, This is rather a question from a "user" than from a sys admin, but I think this forum is apropriate for the question. I have an adress with automatic email forwarding and for some senders (two hietherto), emails are bouncing. This has really created a lot of problems those two time so I... (0 Replies)
Discussion started by: carwe
0 Replies

8. UNIX for Dummies Questions & Answers

sed Or Grep Problem OR Terminal Problem?

I don't know if you guys get this problem sometimes at Terminal but I had been having this problem since yesterday :( Maybe I overdid the Terminal. Even the codes that used to work doesn't work anymore. Here is what 's happening: * I wanted to remove lines containing digits so I used this... (25 Replies)
Discussion started by: Nexeu
25 Replies
FBB::PtrIter(3bobcat)						   Error handler					     FBB::PtrIter(3bobcat)

NAME
FBB::PtrIter - Iterator returning pointer when dereferenced SYNOPSIS
#include <bobcat/ptriter> DESCRIPTION
The PtrIter class template implements an input iterator whose operator* returns the address of the element the iterator refers to. Con- sider a std::unordered_map<std::string, DataType>. Its begin member returns an iterator whose operator* returns a std::pair<std::string, DataType> (const) &. This is usually what you want, but now assume we want to display the map's contents, sorted by its keys. Sorting can simply be performed by defining a support vector containing pointers to the elements in the map, and then sorting the strings the pointers point at. PtrIter is a tool that can be used to construct such a support vector, as shown in the EXAMPLE section. PtrIter is a class template requiring one template type parameter: Iterator, the iterator's type (e.g., vector<string>::iterator) PtrIter's users don't have to specify PtrIter's template type. The function template ptrIter, when provided with an iterator returns the matching PtrIter object. NAMESPACE
FBB All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB. INHERITS FROM
std::iterator<std::input_iterator_tag, ...> FREE FUNCTION
o PtrIter<Iterator> ptrIter(Iterator const &iter): this function template returns a PtrIter object for the function's Iterator argument. This function template simplyfies the con- struction of a PtrIter as no template parameters need to be specified (see also the EXAMPLE section) CONSTRUCTORS
o PtrIter(Iterator const &iter): The iter parameter must be initialized with an existing input iterator, offering operator*, operator++, operator== and operator!=. As PtrIter is a class template, its template type parameters must be specified when defining a PtrIter object. E.g., PtrIter<set<string>::iterator> PtrIter(mySet.begin()); The copy and move constructors are available. OVERLOADED OPERATORS
o PtrType operator*() const: the address of the entity the iterator refers to is returned; o PtrIter &operator++(): the iterator is (pre)incremented to the next position; o bool operator==(PtrIter const &other) const: true is returned if the two iterators are equal; o bool operator!=(PtrIter const &other) const: true is returned if the two iterators are unequal; The copy and move assignment operators are available. DEFINED TYPE
PtrIter defines the following type: o typedef decltype(&*Iterator()) PtrType: MEMBER FUNCTIONS
All members of std::iterator<std:::input_iterator_tag, ...> are available, as FBB::PtrIter inherits from this class. EXAMPLE
#include <algorithm> #include <unordered_map> #include <vector> #include <cstring> #include <iostream> #include <bobcat/ptriter> using namespace std; using namespace FBB; int main() { cout << "Enter lines, the first word will be the map's key; " "^D when done. "; string key; string line; unordered_map<string, string> map; while (cin >> key && getline(cin, line)) // fill the map map[key] = line; cout << ' '; // initialize a support vector<decltype(&*map.begin())> // vector, using ptrIter support(ptrIter(map.begin()), ptrIter(map.end())); // sort 'support' typedef unordered_map<string, string>::value_type VT; sort(support.begin(), support.end(), [&](VT const *p1, VT const *p2) { return strcasecmp(p1->first.c_str(), p2->first.c_str()) < 0; } ); for(auto &element: support) // display sorted by key cout << element->first << ' ' << element->second << ' '; } FILES
bobcat/ptriter - 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::PtrIter(3bobcat)
All times are GMT -4. The time now is 02:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy