49,761 Topics

Member Avatar for
Member Avatar for driebel

I'm having difficulty working with C++'s strings. I'm writing a program to solve a set of linear equations. I'd like to save the solution for various values of N (the size of the system is N X N), and n, a parameter within the system, to a text file, for …

Member Avatar for DemonGal711
0
196
Member Avatar for guest7

Hi, I am getting an error when running a code on linux machine: "terminate called after throwing an instance of 'std::bad_alloc' what(): St9bad_alloc Aborted" In my code i have a 2 dimensional vector defined. Can someone tell me the possible cause of error. Thanks

Member Avatar for guest7
0
78
Member Avatar for kiong

can anyone help me write the code for the below situation using c-string? i'm cracking my head wif tis..... write a program that searches for a TV channel. A user may enter any of the following strings: TV1, TV2, TV4 or TV5. It does not matter if a user search …

Member Avatar for Lerner
0
97
Member Avatar for h3llpunk

Hi I get the common Undefined References error in CodeBlocks I am pretty sure The code is right. [code=c++] case WM_PAINT: { BITMAP bm; PAINTSTRUCT ps; HDC hdc = BeginPaint(hwnd, &ps); HDC hdcMem = CreateCompatibleDC(hdc); HBITMAP hbmOld = (HBITMAP)SelectObject(hdcMem, g_hbmAnime); GetObject(g_hbmAnime, sizeof(bm), &bm); BitBlt(hdc, 150, 100, bm.bmWidth, bm.bmHeight, hdcMem, 0, …

Member Avatar for h3llpunk
0
1K
Member Avatar for GDICommander

Hi, everyone! If you have worked on ACE, this is the post for you. I want to ensure that all the buffer contents of a file are on disk. So I want to use a fsync() or a fflush() function. I'm working with ACE_HANDLEs. Unfortunately, my searches concluded with this: …

Member Avatar for GDICommander
0
218
Member Avatar for jake88

I'm working on another piece of code that did the same thing as my Dom implementation only with Microsoft's System.Xml Here's the idea, I want to take an element and insert some text into it. <nameytag> *insert text here* </slashnameytag> Currently, I have this: [ICODE]#using <mscorlib.dll> #using <System.Xml.dll> using namespace …

Member Avatar for jake88
0
138
Member Avatar for rmlopes

Hello all, Before anything else, this issue is also posted at: [url]http://www.cplusplus.com/forum/general/7518/[/url] I have a structure similar to the one below.I miss a lot of information about the specific template parameters, so I would need something like what is in the code. This code does not compile because we cannot …

Member Avatar for rmlopes
0
149
Member Avatar for monkey_king

Hi, I've written a program for statistic analysis that can be found here [url]http://staff.pubhealth.ku.dk/~ande/web/software/relate.html[/url] I want to make it portable and the program works on unix with the following compilers sun, intel and gcc It also compiles on windows with mingw and the intel compiler. I've installed ms studio, but …

Member Avatar for Nick Evan
0
101
Member Avatar for delerium12345

I'm sorry, I didn't realize I couldn't upload the exe file - but I have it ready to email. I'm having a big problem understanding how to complete this assignment and would really appreciate someone's help in getting me started. Basically, we are taking baby names from a file and …

Member Avatar for Ancient Dragon
0
507
Member Avatar for Happie Juice

ok i have to make a program that asks the user to enter how many kid are in their class, the ask the score for each kid, then display how many are passing. (70/100 is passing). im not sure how to make it count how many times the number 70+ …

Member Avatar for Nick Evan
0
97
Member Avatar for T.N.Sharma

Hi got something magical. node3 ( a variable) seems to point itself when i have not mad it so. Please help me understand this behavior. It seem to me like magic. And do provide with if any suggestion to correct the problem. [CODE] #include<iostream> #include<vector> #include<algorithm> #include<string> #include<fstream> using namespace …

Member Avatar for T.N.Sharma
0
134
Member Avatar for southernd0529

I need help writing a simple program. My Declaration is: length, width, area and perimeter. My Input is length and width. The Calculations are: p=2*(l+w) and a=l*w and my[B] Output is p and a can anyone please help me write this program. I just started out doing this and I …

Member Avatar for Comatose
0
151
Member Avatar for Dontais

I think I'm on the right track, basically trying to count the number of tokens but it keeps telling me cannot convert to a const. [CODE] //This program is made to count the number of words. #include <iostream> using namespace std; #include <cstring> int wordCount(char *); int main() { char …

Member Avatar for Dontais
-1
83
Member Avatar for jrw0267

I am in the process of writing a project and I cant seem to get cout to work at all. I can however print to a file and use cin, and i have included all the necessary io. whenever i compile the program i have a line cout << "hi"; …

Member Avatar for jrw0267
0
60
Member Avatar for skitzo315

I have a person class which writes a name and age to file using binary I/O. By default I need it to create 10 slots for 10 people each set to "null" for name and 0 for age. Then it asks if you want to modify a record and if …

Member Avatar for Ancient Dragon
0
150
Member Avatar for rosenberg_a

The folllowing code has me boggled. Here is a sample of code where you can see that the constructor for the FeetInches class is setting the numbers equal to the private variables inside... [CODE] int main() { // Define a LinkedList object. LinkedList<FeetInches> list; // Define some FeetInches objects. FeetInches …

Member Avatar for rosenberg_a
0
140
Member Avatar for CPPRULZ

So when two objects are declared say class shoe shoe1 and class shoe shoe_copy and then shoe1's variables are set, if the line of code: shoe_copy=shoe1; what would that be doing? After all what is the real data structure of the objects of class shoe?

Member Avatar for MMahmoud
0
144
Member Avatar for liverbird

Hi, I am new to C++ and I'm sure that this is an easy problem to someone who knows C++. I am trying to pass text from a textbox to another textbox on a different form. I would really appreciate any feedback on my code. [B][U]Form 6 Code[/U][/B] [Code] private: …

Member Avatar for cikara21
0
50
Member Avatar for alphabetanm

Hi, I could use some help. Our class assignment is to create a mortgage calculator in C++. The calcuation was provided all we had to do was code it. This is the fourth week of class and the assignment is from Ch. 2. I am sure it is not supposed …

Member Avatar for alphabetanm
0
124
Member Avatar for jaepi

hello there, i just want to ask...how would i apply threading to a web server app?? my problem is, i dunno how to create a web server...i created a simple server that sends hello world to a client that sends a request...how would i apply threading to this one??

Member Avatar for smitz
0
121
Member Avatar for massivefermion

Hey men is it possible to build your own operator with your own definition and your own symbol for every type?

Member Avatar for ArkM
0
91
Member Avatar for jraven1

Hi, I'm having problems checking whether a string is an unsigned integer. The code I am using only checks the first character of the string, so "a1" would return false, but "1a" would return true. Any ideas where I'm going wrong? [code] bool checkUnsignedInt(string *str) { unsigned long value; stringstream …

Member Avatar for ArkM
0
265
Member Avatar for bitRAKE

Hi I'm working on implementing a neural network, but I'm having trouble calculating the error gradient. The problem is I don't know much about calculus and can't understand what exactly to do. I found this Web page that explains it quite well, but I still just can't get it. [url]http://www.willamette.edu/~gorr/classes/cs449/linear2.html[/url] …

Member Avatar for bitRAKE
0
160
Member Avatar for CPPRULZ

If an explicit copy constructor is defined that makes a complex copy, does: [code=C++] int main() { class shoe shoe1; class shoe shoe_copy(shoe1); } [/code] And [code=C++] int main() { class shoe shoe1; class shoe shoe_copy; shoe_copy=shoe1; } [/code] Basically I'm asking if the assignment operator accesses the complex copy …

Member Avatar for CPPRULZ
0
167
Member Avatar for Nick_Plante

I'm fairly new to using C++, but I'd like to make a game like Krypto. To start off, I just need to learn how to make int a - f be a random number between 1 and 100. [code=cplusplus] #include <iostream> #include <string> using namespace std; int main () { …

Member Avatar for GDICommander
0
146
Member Avatar for justluck

Im new to C. is there a way to accept multiple inputs and store them in arrays? lets say 5 inputs and i need to store each of these in an array, is there a way that all 5 can be done at the same time?

Member Avatar for Salem
0
69
Member Avatar for ohara

Hello, i wan to do c++ program in ubuntu that able to write a summary on the directory example is drwx-x John 4096 d-w--x John 14 lrwx-x John 2300 How to i use array to put per column into array then access them so i can generate a report so …

Member Avatar for ohara
0
107
Member Avatar for fidan

Hello, I wrote a program which takes CNF-files as input. It takes from 1 sec up to 1 hour to finish its task (Checking satisfiability). However, there is one CNF file which takes about 1 hours before it spurts out the message: aborted <core dumped> ... and creates an *.exe.stackdump …

Member Avatar for GDICommander
0
162
Member Avatar for tomtetlaw

before i ask this question i want you to keep in mind that i am asking it in general, and i also want a general answer :) i am making a 3d first person shooter and i want to know how i would go about getting a gun infront of …

Member Avatar for _adam_
0
176
Member Avatar for daviddoria

There was another thread about this ([url]http://www.daniweb.com/forums/thread114737.html[/url]) but it didn't seem to be resolved? If I have a vector of int's and another vector of the same length of corresponding names, I would like to sort the ints and have the names "follow" [code] vector<string> Doubles; Doubles.push_back("Name1"); Doubles.push_back("Name2"); Doubles.push_back("Name3"); vector<int> …

Member Avatar for kbshibukumar
0
132

The End.