Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > BOOK: Professional C++, 2nd Edition
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional C++, 2nd Edition
This is the forum to discuss the Wrox book Professional C++, 2nd Edition by Marc Gregoire, Nicholas A. Solter, Scott J. Kleper ; ISBN: 978-1-1181-6995-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C++, 2nd Edition section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 19th, 2011, 01:02 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Compiler trouble all of a sudden

I've been using code::blocks for I don't know how long and it's always worked just fine. All of a sudden it started throwing this "error: in C++98 'myVector' must be initialized by constructor, not by '(...)'".

I wish I knew why it was talking about C++98 instead of C++11. If anyone can lend me some insight, I'd greatly appreciate it.

Thanks
  #2 (permalink)  
Old December 19th, 2011, 01:01 PM
Wrox Author
Points: 220, Level: 4
Points: 220, Level: 4 Points: 220, Level: 4 Points: 220, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2011
Posts: 49
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Did you double check all project settings in code::blocks?
  #3 (permalink)  
Old December 19th, 2011, 02:39 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No, I'm not really sure what settings it should have. Here's the code that I've been having a problem with.

Code:
#include <string>
#include <vector>
#include <iostream>
using namespace std;
int main()
{
     vector<string> myVector = {"A first string", "A second string"};
     // adding some vectors using push_back
     myVector.push_back("A third string");
     myVector.push_back("The last string in the vector");
     // iterate over the elements in the vector and print them
     for (auto iterator = myVector.cbegin();
          Iterator != myVector.cend(); ++iterator)  {
          cout << *iterator << endl;
     }
     // print the elements again using C++11 range-based for loop
     for (auto& str : myVector)
          cout << str << endl;
     return 0;
}
  #4 (permalink)  
Old December 19th, 2011, 02:53 PM
Wrox Author
Points: 220, Level: 4
Points: 220, Level: 4 Points: 220, Level: 4 Points: 220, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2011
Posts: 49
Thanks: 0
Thanked 4 Times in 4 Posts
Default

See if this helps: http://www.cplusplus.com/forum/beginner/31758/
  #5 (permalink)  
Old June 30th, 2012, 06:45 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2012
Location: Philippines
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sir can you give me a sample of ifstream that can save, edit and delete files on a database.
  #6 (permalink)  
Old June 30th, 2012, 06:59 AM
Wrox Author
Points: 220, Level: 4
Points: 220, Level: 4 Points: 220, Level: 4 Points: 220, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2011
Posts: 49
Thanks: 0
Thanked 4 Times in 4 Posts
Default

You will have to check your database and your database access layer to see how it supports files. Search for the term BLOB, which means Binary Large Object, which can be used to store files in a database.
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
sudden localhost port issue ceric67 BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 6 March 5th, 2009 04:48 PM
Compiler Romaunt V. Intro Programming 2 October 18th, 2008 06:27 AM
TBH - Errors and warnings all of a sudden! codewife55 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 November 12th, 2006 05:58 PM
For all who need a C/C++ compiler... Ammiel C++ Programming 1 July 17th, 2003 01:42 PM



All times are GMT -4. The time now is 06:20 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.