Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 19th, 2011, 02:02 AM
Registered User
 
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
 
Old December 19th, 2011, 02:01 PM
Wrox Author
 
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?
 
Old December 19th, 2011, 03:39 PM
Registered User
 
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;
}
 
Old December 19th, 2011, 03:53 PM
Wrox Author
 
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/
 
Old June 30th, 2012, 06:45 AM
Registered User
 
Join Date: Jun 2012
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.
 
Old June 30th, 2012, 06:59 AM
Wrox Author
 
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.





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 05: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 06:58 PM
For all who need a C/C++ compiler... Ammiel C++ Programming 1 July 17th, 2003 01:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.