49,761 Topics

Member Avatar for
Member Avatar for guest7

Hello, I am getting the follwoing error in my program: *** glibc detected *** free(): invalid pointer The program is as follows. [ICODE]int main() { operation1* sjob1 = new operation1(); answer* ans1 = sjob1->execute(); delete sjob1; operation2* sjob2 = new operation2(); answer* ans2 = sjob2->execute(); return 0; }[/ICODE] I have …

Member Avatar for Topi Ojala
0
199
Member Avatar for gretty

Hi I am making a rock, paper scissors game for fun & for practice. My problem is; I am trying to create a string by adding 2 character variables together. How do I do this? Do I use the insert function? Or something I think is called crstrt or something …

Member Avatar for jephthah
0
699
Member Avatar for bjanbkboi

I'm trying to read a file into a vector using structure...[CODE]#include <fstream> #include <iostream> #include <vector> #include <cstdlib> using namespace std; struct StudentRecord { int ID; char FirstName[30]; char LastName[30]; char Grade[1]; }; void read_file(char FileName[20],vector<StudentRecord> &students) { ifstream Students(FileName, ios::in); char S_ID[10]; /* char FName[30]; char LName[30]; char S_Grade[1];*/ …

Member Avatar for ArkM
1
106
Member Avatar for jazu100

Hi, to answer this question you need to have some experience about php... i'm planning to create a http server that supports cgi. Does anyone see the problem in C++ -source? Php doesn't give any output, but if I don't set the rfc3875 environment variables, all output comes normally (expect …

Member Avatar for ShawnCplus
0
838
Member Avatar for vivek3227

Hi , Can ne1 tell me how 2 write a c++ program to find out the determinant of a (mxn ) matrix (need not to be square ).. If possible give me the code ,of some link whr I can find it ...

Member Avatar for siddhant3s
0
121
Member Avatar for clisen

Hey everyone, I'm relatively new to C++, cant seem to find a solution to my problem. I'm trying to randomly generate an array of class objects. I'm using rand() to generate a number 1-3, for the number of objects to generate. For some reason when I use: [code] int c_gen …

Member Avatar for clisen
0
183
Member Avatar for john_beginner

hello, i'm new to cpp & I wanna know that in C++ if there is multiple inheritance is done suppose, Class A & Class B public,protected member is inherted in Class C like, [code] class A { protected: int no1; public: void get_a(void) { cout<<"Class A"; } }; class B …

Member Avatar for indianapple89
0
108
Member Avatar for azjherben

I'm getting an error where it says I'm trying to use a null pointer. Then when I click ignore another error saying I tried to read or write protected memory. Any idea how to fix? [code] private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { using namespace System::Runtime::InteropServices; using namespace System; using …

Member Avatar for jencas
0
262
Member Avatar for unclepauly

im making a singleton class in c++ and have a couple of questions. first, heres my .h and .cpp files: [CODE] // Singleton.h class Singleton { public: static Singleton GetSingleton(); void DoSomething(); ~Singleton(); private: Singleton(); static Singleton* _instance; }; [/CODE] [CODE] //Singleton.cpp Singleton* Singleton::_instance = 0;// initialize pointer //********************************************************************************************* Singleton::Singleton() …

Member Avatar for jencas
0
2K
Member Avatar for luoleicn

Hi all: Can anybody tell my why this simple code which used pthread_cancel to kill another thread throws "terminate called without an active exception". Yes , I used google but what I found is not what I want. I want to kill thread at once so I use pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); …

Member Avatar for luoleicn
0
102
Member Avatar for timb89

10 marks Write a RECURSIVE function which when passed a string s will return true if s is a palindrome and otherwise false. A palindrome is a string which is the same if reversed eg radar, rotor, noon, racecar. past paper question which im doing at the moment as got …

Member Avatar for Stinomus
0
1K
Member Avatar for Kob0724

Hey guys, I have what I would consider a fairly unique problem. I'm not even sure where to start looking for a solution. I have template class that uses a typedef to define a map. But when I go to make an iterator for that map, I get a compile …

Member Avatar for siddhant3s
0
171
Member Avatar for eliza2044

Hey guys, I've been developing an application which transforms files generated by an aircraft transponder into KML files that will be loaded on Google earth. As these KML files are more or less XML files I'm trying to parse XML files. I have downloaded and the xerces library. According to …

Member Avatar for eliza2044
0
251
Member Avatar for snyp

hi, i am not really that good at c++. i have created an application which dynamically loads dll's as types of 'plugin' the problem i am trying to overcome is linking back to code in the application from the dll. i am currently within the scope of a function of …

Member Avatar for Ancient Dragon
0
254
Member Avatar for JaksLax

Here is my code: [CODE] #include "Poly.h" int main(){ Poly p; int degree = p.degree(); cout << degree << endl; int coefficient = p.coefficient(5); return 0; } [/CODE] [CODE] #include<iostream> using namespace std; class Poly{ public: Poly(); //constructor int degree(); //Returns the degree of the polynomial int coefficient(int); //Returns the …

Member Avatar for Stinomus
0
113
Member Avatar for JackDurden

Would someone be so kind as to help me with this insert. The function insert takes two numbers, num and num2. num is the number to insert in the tree and num2 is the number of children to the parent node where num is inserted. I am getting errors for …

Member Avatar for VernonDozier
0
104
Member Avatar for gretty

Hi I am studying for my C++ exam coming up & I have this practice question thats confusing me? [QUOTE]Given enum months{Jan = 1, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec}; write a C++ function that takes currentMonth of type months as the parameter, and returns …

Member Avatar for yun
0
169
Member Avatar for guest7

Hi, I have a c++ program which uses the api's of a utlitiy. As per the document I have to include the path of binaries for the utility in my code. I am not sure why that is required and how to inlcude that. Any help is appreciated Thanks

Member Avatar for guest7
0
104
Member Avatar for m24r

I am a newbie and want to build a excelchart from excel file in Borland C++. Can anyone helpme out. I have installed the excel components in my codegear project.

0
80
Member Avatar for dumrat

Hi, I wrote the following macro: [CODE] #define COM " #define GET_VAR_LINE(var, type) COM var = %type COM, var [/CODE] So, this code : [CODE] int main() { int x = 0; printf(GET_VAR_LINE(x, d)); }[/CODE] expands to [CODE] int main() { int x = 0; printf(" x = %d ", …

Member Avatar for ArkM
0
126
Member Avatar for osmano807

Hello, I need to get remote file size through the url to a function. The problem is that I'm not getting! Trying with the functions of libcURL, but I am not getting. Is there any way to get the size of a remote file by url?

Member Avatar for osmano807
0
1K
Member Avatar for ixuz

Hello I have had this problem for a while now, I am getting bluescreen when I start my debug.exe from my debug folder manually, but I do not get bluescreen when compiling and starting from C::B. But there is an exception, my program only bluescreens if I start it before …

Member Avatar for Salem
0
182
Member Avatar for krishnampkkm

hiii I know VCNs(Virtual cluster number) are clusters within a particular file, LCNs(Logical cluster number) are clusters on the volume. Thus VCN 0 of a file may map to LCN 2394 of a volume, VCN 1 may map to LCN 104227, and so on. So my doubt is the the …

Member Avatar for Salem
0
118
Member Avatar for vishalag

Hi, I want to pass tree as an argument to other function in C. I am able to pass the tree comfortably,but how do I access the children of the tree in the called function??? TIA Best Regards Vishal Agarwal

Member Avatar for Sky Diploma
0
106
Member Avatar for mathueie
Member Avatar for yazooney

Hi, I have, for example, the memory address of a double value which is: 245CEA20 I need to do something like this: [CODE]double * value = 0; value+= 0x245CEA20; std::cout << value << std::endl;[/CODE] I get a value like 22E75100 which is wrong even if you convert it to decimal …

Member Avatar for yazooney
0
3K
Member Avatar for lexusdominus

Hey. I have to say this is the first time ive been totally stumped by c++. I cant exit this loop. this code is from a function that takes a string filename, an int mode, and a char print. It takes a textfile looking like this: somesite.netinfoaboutsomesite someothersite.orgdataonsomeothersite yetanotherrandomsite.edurandomchars and …

Member Avatar for lexusdominus
0
140
Member Avatar for timb89

[code] bool isReverse(string s1,string s2) // pre : none // post : returns true if s1 is reverse of s2 and otherwise false { if (s1.length() != s2.length()) { return false; } int size = s1.length(); int count = 0; else { for (int i = 0; i < size; …

Member Avatar for ArkM
0
104
Member Avatar for gnobber

Hi, im just beginning c++ and been reading regarding cin and cout. After reading the chapter, I just got curious what acually a stream is. It is said in some as a series of characters. In a site: "A stream is an abstraction that represents a device on which input …

Member Avatar for sai sushma
0
148
Member Avatar for nustian

Q:- create a class in which you will declare a pointer to int . This variable will be defined n allocated memory in the constructor. Create a destructor of the class where this memory will be deallocated. Using this class do the following: 1) In the main function create an …

Member Avatar for ArkM
0
143

The End.