49,761 Topics
| |
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 … | |
Hey, I was just wondering how I can get it so when I click a button it opens my second form. But sets some of the labels to a specific thing, so I don't end up making 170+ forms for my periodic table application. Just like so when I click … | |
how to do this? : ask the user to insert the length of two sides (b and c) of a tringle and the angle between them in degree (x), compute and print the length of the third side,a, by using this formula a^2=b^2+c^2-2bc(cos(x)) (Note: to use the cosine function(cos), the … | |
I dug a lot around the internet to find a .Chr Editor/Opener .CHR file I pointed refers to the one Borland Made. It is a Character Set File or more like a Font file.. Turbo C++ uses this file format. I was hoping if anyone could help me find its … | |
Hello there, I have here a problem with the function open(). Since its first parameter asks for a char*, how would i convert wchar_t* to char* if my program asks for a wchar_t* as its path rather than char*? | |
Effective January 1st of each year, Gabriela receives a 5% raise on her previous year’s salary. She wants a program that calculates and displays the amount of her annual raises for the next three years. The program also should calculate and display her total salary for the three years. Annual … | |
hey guys!!! iam just working on speed of the codes.. and i just want to extract the last bit of the given variable.could u help me??? note:dont extract the bits by dividing it by 2:):) | |
What are the possible uses of the bitwise operators. i.e. bitwise AND, bitwise OR, bitwise XOR, shift right, shift left and complement. Also, what are the applications of bitwise operators in everyday problem solving. Examples would be nice. Thanks in advance | |
Write a program to calculate the power consumed by a heater. This program also calculates the resistance value for the heater. The program’s design should use main that calls the three functions described below: a) getData : Read data from the keyboard. This function is to use reference parameters (pass-by-reference … | |
I try to run the following, but I keep getting the error "error C2664: 'Card::SetName' : cannot convert parameter 1 from 'const char [23]' to 'char'" I also got the following error; error C2664: 'Beginning' : cannot convert parameter 2 from 'std::vector<_Ty>' to 'std::vector<_Ty> &' I'm not that familiar with … | |
Hello ma'am/sir any help for the codes of input to be align.heres my code: [CODE] #include<iostream> using namespace std; int main() { float pre, mid, semi, final, total; cout << "Prelim: "<<setw(20)<< "Midterm: "<<setw(20)<< "Semifinal: "<<setw(20)<< "Final: "<<setw(20)<< "Final grade: \n"; cin>>pre>>mid>>semi>>final>>total; total = (pre+mid+semi+final)/4; system("pause"); return 0; } [/CODE] … | |
Hi, This is probably some basic knowledge but I haven't found it out. I have this snippet of code that is causing me problems: [CODE] HANDLE hFile; char lpBuffer[100] =""; char idBuffer[100] = ""; DWORD ofs; strcpy(lpBuffer, fingerprint); strcat(lpBuffer,"\0"); hFile = CreateFile(buffer,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,NULL); WriteFile(hFile,lpBuffer,sizeof(lpBuffer), &ofs, NULL); strcpy(buffer,""); if(ReadFile(hFile, … | |
Hi , I am a newbee to visual c++ 2008, I have to include a RTP prtocol library JRTPLIB into visual c++ 2008. could any one please brief the steps to do it. I dont know how to include these libraries into visual c++. with regards, Hari | |
Hello. I am i'm recently taking off in building a game. The problem at the moment, is that i fear i'm programming to much! I wouldn't know this because i'm new to c++, but how much code is too much for a modern processor? In my engines render loop i … |
The End.