48,986 Topics

Member Avatar for
Member Avatar for trantran

I am reading Exceptional C++ (Herb Sutter) and there is something that I don't get at all concerning vector insertion. On page 59 it says: 1) "multi-elements inserts ("iterator range" inserts) are never strongly exception-safe" 2) "for vector<T>.... inserts and erases (whether single- or multi-elements) are strongly exception-save as long …

Member Avatar for trantran
0
375
Member Avatar for vishwanath.m

hey guys i just get time limit exceeded error wen ever i submit a pgm wid large values.. how to avoid it. do not use file to store variables

Member Avatar for Narue
0
146
Member Avatar for CrazyMisho

ok i try to write a linked list of objects from one class here is the the class: [CODE] class detail{ int code; string unit; string name; float price; public: detail(int c, string u, string n, float p); int get_code(){return code;}; string get_unit(){return unit;}; string get_name(){return name;}; float get_price(){return price;}; …

Member Avatar for Chilton
0
141
Member Avatar for johnnyboyslim
Member Avatar for Chilton
0
60
Member Avatar for BoBok2002

I drew a circle to represent a human face. I am drawing an arc to represent the mouth but I am having troubling positioning it in the right place. I have checked the value of x and y in the computation of the arc but can't seem to figure out …

Member Avatar for BoBok2002
0
133
Member Avatar for edbtzy

I am trying to create a client to connect to a mysql database using sockets. I have the following code but of course, its not working to my advantage. Right now, this code connects to a server file located on a linux machine...i havent coded it yet to connect to …

Member Avatar for gerard4143
0
188
Member Avatar for HASHMI007

[QUOTE]Que.h Header file [/QUOTE] [CODE]template < class T> class Que{ public : Que(); Que(int max); ~Que(); int isFull()const ; int isEmpty()const ; void Insert( T newItem); void Remove(T & item); private : int front , rear; int maxQue; int count ; T * Items; // Dynamic Arry Implementation }; template …

Member Avatar for HASHMI007
0
161
Member Avatar for meme dreame

hey guy's iam a biggner at data structure n there z a program i did it bt everytime i run it doesn't work with me and i dono what is the wrong on it can somebody help me plz [CODE]#include <iostream> #include <string> using namespace std; class student_grades{ private: string …

Member Avatar for meme dreame
0
106
Member Avatar for f4fjks

[CODE]#include<stdio.h> #include<graphics.h> #include<stdlib.h> #include<conio.h> void main() { int graphdriver=DETECT,graphmode; int color,n,m; initgraph(&graphdriver,&graphmode,"C:\\TC\\BGI"); for(n=0;n<10;n++) { putpixel(250+n,350,BLUE); } for(m=0;m<10;m++) { int x=getpixel(250+m,350); printf("%d",x); } getch(); }[/CODE] please any one help me solving errors..

Member Avatar for WaltP
0
163
Member Avatar for UNDER-18 FG

Hi! I have another assignment regarding writing a program based on a given output. Here's the Output given: Output: Enter your date of birth: Day: Month: Year: My birth date is on 31 August 1980. So, here's my answer( Although it is wrong; with about 6 ERRORS in it): [CODE]#include …

Member Avatar for Fbody
0
162
Member Avatar for toneranger

Hi everyone, When I try the code below with data in a txt file, I have no problems and the data prints properly and neatly on the screen. (Note, one slight modification when using a txt file, instead of getline (ist, ignored, ','), I do getline (ist, ignored, '/t') to …

Member Avatar for MonsieurPointer
0
227
Member Avatar for UNDER-18 FG

Hi! I have another assignment regarding writing a program based on a given output. Here's the Output given: Output: Enter your date of birth: Day: Month: Year: My birth date is on 31 August 1980. So, here's my answer( Although it is wrong; with about 6 ERRORS in it): [CODE]#include …

Member Avatar for hiddepolen
0
374
Member Avatar for senergy

Hi, how can I read specific data from file? let's say I have file containing this: [code]Data1: 1 Data2: 2 Data3: 3 Data4: 4[/code] how can I make program find "Data1: " and then get everything what's behind it? or like in some configs, there is: [code]<Something: "something2", "something3">[/code] how …

Member Avatar for senergy
0
4K
Member Avatar for supershame

Hi, Im getting segmentation fault in calling getDocument. I have a class Sample which is the parent node. Im getting 0 as a return here's my code. parser code: int xml::load(const char* xmlFile){ try { XMLPlatformUtils::Initialize(); // Initialize xerces } XercesDOMParser* parser = new XercesDOMParser(); parser->setValidationScheme(XercesDOMParser::Val_Always); parser->setDoNamespaces(true); ErrorHandler* errHandler = …

0
36
Member Avatar for digital_signage
Member Avatar for hiddepolen
0
54
Member Avatar for smallB

Hi, I have a problem with linking boost libraries in codeblocks using gcc 4.6.1. I'm getting following errors: undefined reference to `vtable for boost::unit_test::unit_test_log_t' How can I solve it?

Member Avatar for smallB
0
157
Member Avatar for mcclainra

I've been given a basic form of programming to do. And I simply cannot figure it out. I know this topic has been covered several times before. But each of them going around the one crucial step that I need to complete my programming. My instructor insists that the 24 …

Member Avatar for mcclainra
0
2K
Member Avatar for UNDER-18 FG

Hi. I'm new here. Anyway, I have an assignment of writing programs from outputs provided. Here's an output given in the assignment that I think is wrongly done. I'm saying this because I tried many, many times just to get the exact output, but only to no avail. So, I …

Member Avatar for UNDER-18 FG
0
122
Member Avatar for champa anand

Hi, Here is the code [CODE]bool A::clear(void) { if (m_active) { return val; } else { return true; } } // end A::clear bool A::initialize(void) { if (m_active) { return clear(); } else { return true; } } // end A::initialize[/CODE] getting the below segmenation fault as soon as it …

Member Avatar for champa anand
0
90
Member Avatar for cyberguy007
Member Avatar for sanof3322
0
29K
Member Avatar for gotnos

I have tried to structure my program but im stuck at this point. I have a file that contains phone phrases on each line (1-900-WINNING) is one of the phrases, if i get more digits than a phone number requires i must ignore the remainder. This data is coming from …

Member Avatar for WaltP
0
148
Member Avatar for stereomatching

compiler : gcc4.6.2(minGW), vc2010 os : win7 64bits [CODE] int A[10]; srand(0); std::generate(A, A + sizeof_array(A), [](){ return rand() % 100; } ); std::vector< std::unique_ptr<int> > v; std::for_each(A, A + sizeof_array(A), [&](int const Cur) { v.push_back(std::unique_ptr<int>( new int(Cur) )); } ); std::sort( v.begin(),v.end() ); //result {1,4,8} for(auto it = v.begin(); …

0
88
Member Avatar for stereomatching

I do some experiences about boost::bind And I find out that boost::bind would incur heavy copy if you don't pass by referene [code] #include<iostream> #include<boost/bind.hpp> struct test_for_bind_00 { test_for_bind_00() {} test_for_bind_00(test_for_bind_00 const &Obj) { std::cout<<"this is copy constructor :: tfb00"<<std::endl; } }; struct test_for_bind { void tamaya() { std::cout<<"tamaya"<<std::endl; } …

Member Avatar for stereomatching
0
307
Member Avatar for Zssffssz

well it sounds simpler than OpenGL... I want to use DOS style graphics in my prog (look at SC2000) no need for animation or interactivity or PostPicture(). So the queston is what header/librays do I need and how do i use it? Google just brought up stuff on makeing your …

Member Avatar for Zssffssz
0
204
Member Avatar for ggreen33697

I'm having trouble writing a for loop that asks the user to input the number of seconds an object falls and the height it falls from. the program has to calculate the distance fallen for each second using the formula d=0.5*g*t2

Member Avatar for Clinton Portis
0
112
Member Avatar for Labdabeta

I am VERY confused by the Doxygen configuration file. I cant seem to figure out how to make it compile code between [ICODE]#ifdef __cplusplus[/ICODE] and [ICODE]#endif[/ICODE] Also I dont understand how to change what it does with preprocessor symbols or how to make it NOT generate documentation on something. Any …

Member Avatar for mike_2000_17
0
155
Member Avatar for Tom_Weston

Basically, what i would like is if the two letters are attached together (NOT seperated) in the string, it will say good, if not the bad. Example: [CODE] #include <iostream> #include <string> int main () { string letters = "or"; string test = "The man went to the store."; //here …

Member Avatar for WaltP
0
155
Member Avatar for Labdabeta
Member Avatar for rubberman
0
138
Member Avatar for toneranger

I have some stock market price data organized as follows in a structure: struct PriceInfo { string Date; unsigned int Time; double Open; double High; double Low; double Close; unsigned int Volume; }; This struct organizes price data per interval of date and interval of time, where time is measured …

Member Avatar for toneranger
0
849
Member Avatar for Algorithms

Hi brand new, Okay so I have an exercise I'm doing to better help understand C++ programming. This isn't a project or homework assignment. I'm doing this for practice and to better my skills as a programmer. I have the logic down, now I just need to add to the …

Member Avatar for hiddepolen
0
922

The End.