48,986 Topics
| |
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 … | |
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 | |
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;}; … | |
void Sort(string [][2],int,char direction='A'); What does the char direction = 'A' mean? | |
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 … | |
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 … | |
| [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 … |
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 … | |
[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.. | |
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 … | |
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 … | |
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 … | |
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 … | |
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 = … | |
In c++, how to use [B]class[/B]? Give me a best answer. I will wait you. | |
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? | |
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 … | |
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 … | |
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 … | |
Is there any if statement to check if a file is empty or not? | |
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 … | |
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(); … | |
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; } … | |
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 … | |
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 | |
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 … | |
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 … | |
| |
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 … | |
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 … |
The End.