Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
std%3a%3avector
- Page 1
Re: how to create a simple elevator simulation?
Programming
Software Development
3 Days Ago
by trueframe
To make a basic elevator simulation, first, identify the floors and the elevator's capacity. Then, use loops and conditionals in programming to mimic its movement. Include buttons for users to call the elevator and select floors. Test thoroughly for accuracy.
Re: Improve HAVING BY performance
Programming
Databases
3 Weeks Ago
by toneewa
…stmt = con->createStatement(); auto start_time0 =
std
::chrono::high_resolution_clock::now(); // SQL query stmt->…<< endl; } auto end_time1 =
std
::chrono::high_resolution_clock::now();
std
::chrono::duration<double> elapsed_seconds1 = end_time1 …
Re: C++ programming error
Programming
2 Months Ago
by rproffitt
…/language/escape Example follows: #include <iostream> using namespace
std
; int main() { cout << "furey, edward \"sphere…
std::endl vs newline
Programming
Software Development
9 Years Ago
by Tycellent
std
::endl vs \n Are any particular one which should be used at specific times? I understand endl flushes the stream (although i'm not 100% what this means) while \n is simply a newline.
Re: std::string question!
Programming
Software Development
13 Years Ago
by pseudorandom21
std
::string is a C++ class (or maybe a typedef'd … access operator ([b] . [/b] ). i.e., [code]
std
::string input;
std
::cin >> input;
std
::cout << "Size =" <…;< input.size() <<
std
::endl; input.clear();
std
::cout << "Size =" << input…
Re: std::ofstream fs(string Vriable)
Programming
Software Development
10 Years Ago
by Lucaci Andrew
`
std
::string` are different from `C-style` strings (null terminated sequences of characters). For your example, use the `.c_str()` function from the `string` class to get the `C-style` string.
std
::ofstream Myfile(mystring.c_str()); [Click Here](http://www.cplusplus.com/reference/string/string/c_str/) to get more info.
std::remove has differing syntax in VIsual Studio
Programming
Software Development
11 Years Ago
by Hazardous_Byte
… of a vector based on it's contents: using namespace
std
; . . . vector<int> v; v.push_back(4); v.push_back…(5); v.push_back(6); v.push_back(7); v.erase(
std
::remove(v.begin(), v.end(), 6), v.end()); This USUALLY…
Re: std::remove has differing syntax in VIsual Studio
Programming
Software Development
11 Years Ago
by mike_2000_17
…. And you might also want to remove the `using namespace
std
;` statement. This remove function that you are getting is [this…
Re: std::endl vs newline
Programming
Software Development
9 Years Ago
by rubberman
A newline in a string is just some more data to send, whereas
std
::endl will send a newline and then flush the output. You can also use
std
::flush to flush the output in those cases where you don't want a newline (input prompts for example). IE: `cout << "Enter code:" <<
std
::flush;`
Re: std::endl vs newline
Programming
Software Development
9 Years Ago
by deceptikon
… output statement and the stream must be flushed with `
std
::endl` or `
std
::flush` are surprisingly rare, mostly due to tied streams…
std::vector access violation on push_back
Programming
Software Development
11 Years Ago
by sciwizeh
…include <fstream>
std
::string parse::stringFromFile(
std
::string filename){
std
::ostringstream oss;
std
::ifstream file(filename); if(…SymbolNode { public: SymbolRootNode(); void add(
std
::string s);
std
::string ancestry() const;
std
::string nextSymbol(PushbackPtr r, int first…
Re: std::vector access violation on push_back
Programming
Software Development
11 Years Ago
by sciwizeh
…The Token constructor looks like this: TokenType ttype;
std
::string sval; double nval; Token() : ttype(…sval(""),nval(0){} Token(TokenType tt,
std
::string s, double d) : ttype(tt),sval(… just: TokenType type() const {return ttype;}
std
::string strval()const {return sval;} As far …
std::copy a std::vector of std::pair to std::cout
Programming
Software Development
15 Years Ago
by Dave Sinkula
…it != wavs.end(); ++it ) { string temp(*it);
std
::pair<string, string> entry; entry.first = ….second = temp; renamer.push_back(entry); }
std
::copy(wavs.begin(), wavs.end(), ostream_iterator<string…>(cout, "\n"));
std
::copy(phrases.begin(), phrases.end(), ostream_iterator<…
Re: std::copy a std::vector of std::pair to std::cout
Programming
Software Development
15 Years Ago
by Dave Sinkula
…that something is wrong with user-defined functionality and
std
, or whether it's that the standard library does… not provide an operator<< for
std
::pair<>. [/QUOTE] [url]http://groups.google…;int const, int> is from
std
std
::ostream is from
std
inside the
std
::ostream_iterator, where operator<< is called…
std::tuple and boost::tuple don't support rvalue reference?
Programming
Software Development
12 Years Ago
by stereomatching
… something like this [code]
std
::tuple<
std
::string> kkk() {
std
::string temp = "temp"; return
std
::make_tuple(
std
::move(temp) ); } [/code] This…(strMove) ); [/code] This one is okay [code]
std
::shared_ptr<
std
::string> strShared(new
std
::string("wawawa")); boost::tuple<…
std::map help!!
Programming
Software Development
10 Years Ago
by glenwill101
…gt;, Object*>::iterator {aka
std
::_Rb_tree_iterator<
std
::pair<const
std
::basic_string<char>, Object*>…gt;, Object>::iterator {aka
std
::_Rb_tree_iterator<
std
::pair<const
std
::basic_string<char>, Object>… Object*,
std
::less<
std
::basic_string<char> >,
std
::allocator<
std
::pair<const
std
::basic_string<…
std::map with char*
Programming
Software Development
14 Years Ago
by monkey_king
…c, I know it's generally a bad idea but
std
::strings are to slow. [CODE=c++] #include<iostream…=strtok(NULL," \t"); } return asso; } void cleanup(
std
::map<const char*,int,cmp_str> &asso….begin(),asso.end()); } int main(int argc, char** argv){
std
::map <const char*, int,cmp_str> asso = build(); …
Re: std::tuple and boost::tuple don't support rvalue reference?
Programming
Software Development
12 Years Ago
by vijayan121
… > tuple<TYPES...>
std
::make_tuple( TYPES&&... args ) ; returns
std
::tuple<TYPES...>(
std
::forward<TYPES...>(args…...) ) ; with
std
::reference_wrapper<T> unwrapped…
Re: std::copy and operator<< overload for ostream
Programming
Software Development
10 Years Ago
by mike_2000_17
…algorithm> #include <iterator> using namespace
std
; // create a type to hold a "doubled…<-- print the doubled value. } int main() {
std
::vector<int> myVector = {34,54,43,2…(auto it = myVector.begin(); it != myVector.end(); ++it)
std
::cout << (*it) * 2 << "…
Re: std::map help!!
Programming
Software Development
10 Years Ago
by Moschops
You're trying to make an iterator that deals with maps like this: `
std
::map<string, Object>` but your actual map looks like this:`
std
::map<string, Object*>` As an aside, one of the very useful things brought to us by C++11 is the auto keyword allowing you to make iterators something like this: `auto itr=_c.begin();`
Re: std::map help!!
Programming
Software Development
10 Years Ago
by mike_2000_17
You just forgot the `*` next to the type `Object` in your for-loop. It should be: for(
std
::map<string, Object* >::iterator itr=_c.begin(); itr < _c.end(); itr++)
std::string::size_type and typedef
Programming
Software Development
9 Years Ago
by Sarkurd
… a book but i don't understand `
std
::string::size_type` and some other data types specially …;<<
std
::endl;
std
::string result=""; //
std
::string::size_type n; int n; while (
std
::cin >&…if (n < hexdigits.size()) result += hexdigits[n];
std
::cout << "Your hex number is: "…
Re: std::string::size_type and typedef
Programming
Software Development
9 Years Ago
by mike_2000_17
…(as one should!) like `
std
::unique_ptr` or `
std
::shared_ptr`, you still need to …T> class vector { public: typedef
std
::size_t size_type; size_type size() const; size_type … void resize(size_type new_sz); ... // If
std
::size_t was used everywhere, then changing it would…
Re: std::sort
Programming
Software Development
15 Years Ago
by Jennifer84
… of a problem to make this work. [code]
std
::vector<string> Sorting;
std
::string One = "-20.45,ab"…Three = "-3.52,c";
std
::string Four = "03.55,defg";
std
::string Five = "-12.44,es"…;;
std
::string Six = "12.44,ffdasd"…
Re: std::sort
Programming
Software Development
15 Years Ago
by VernonDozier
… to make this work. [code]
std
::vector<string> Sorting;
std
::string One = "-20.45,…"03.55,defg";
std
::string Five = "-12.44,es";
std
::string Six = "12.44… Sorting.push_back(Four); Sorting.push_back(Five); Sorting.push_back(Six);
std
::sort( Sorting.rbegin(), Sorting.rend() ); [/code][/QUOTE] …
Re: std::sort
Programming
Software Development
15 Years Ago
by Ancient Dragon
… f2) ? true : false; } int main() {
std
::vector<string> Sorting;
std
::string One = "-20.45,ab"…Sorting.push_back(Four); Sorting.push_back(Five); Sorting.push_back(Six);
std
::sort( Sorting.begin(), Sorting.end(), compare_on_asscending_value ); for(int….php?t=121049&highlight=
std
%
3A
%3Asort"]here[/URL].
Re: std::sort
Programming
Software Development
15 Years Ago
by Jennifer84
…be [I]seened [/I]by the
std
::sort inside my buttoncontrol. Thank you... [code]
std
::string a = "1.1…";
std
::string b = "22.2";
std
::string c = "-…1.1";
std
::string d = "-22.2";
std
::vector<string>…
Re: std::map with char*
Programming
Software Development
14 Years Ago
by ArkM
…-strings to preallocated buffers chain (or even into
std
::string with a proper capacity) including terminating zero… 2. Allocate large buffer fo process file (use
std
::filebuf and putsetbuf member to assign large preallocated buffer…usually are much more faster (that's proved ;))...
std
::string is not a bottleneck, see points above (…
std::cout and wstring
Programming
Software Development
14 Years Ago
by Kashaku
… btw, I've also heard something about
std
::wcout, but that didnt work for me either…CPerson { int *PAge;
std
::wstring *PName; public: CPerson (int,
std
::wstring); int ShowAge();
std
::wstring ShowName(); }; CPerson::…main () { CPerson BPerson(5, TEXT("Hello"));
std
::cout << BPerson.ShowAge() << BPerson…
std::map insert crashes
Programming
Software Development
12 Years Ago
by Dman01
… entitymanager, though I just copied it. He used
std
::map to collect all entities as pointers which are…,0.0)); } [/CODE] Whats not working : [CODE]typedef
std
::map<int, BaseGameEntity*> EntityMap; EntityMap m_EntityMap; //... void…virtual methods but not well enough with
std
::maps, though I know
std
::vector well, which is kinda the …
1
2
3
17
Next
Last
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Meet People
Forums
Top Members
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC