- Strength to Increase Rep
- +4
- Strength to Decrease Rep
- -1
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Folks, I'm having some trouble with overloading the '<<' operator for a templated class. For example, given a very simple template class like this: [code] template<class T = double> class Real { T m_value; public: Real( T val = 0 ){ m_value = val; } T get() const { return … |
|
Hey so as i mentioned here [url]http://www.daniweb.com/forums/post840142.html[/url] i need to check if a process is responding by using sendmessage however i have no idea how to get the hwnd because i start the process using system::diagnostics::process [CODE] process->StartInfo->WorkingDirectory=sinfo->workingDirectory; process->StartInfo->Arguments=" -exec "+sinfo->init+" -port "+sinfo->port+" "+sinfo->options; process->StartInfo->FileName = sinfo->exe; process->StartInfo->UseShellExecute=true; [/CODE] so … |
|
I have the following code below which is part of a program to create a Huffman Coding tree. The problem is that it runs through correctly for one node, outputting that character 'l' for a certain file has a specific frequency. However...after going through several iterations, it runs into a … |
|
|
I'm not good in C++ and I need your help. I have some small program that can automatically play chess in internet chess servers. It needs only the chess engine to play. I play only on [url]www.kurnik.org[/url], but from a few months they changed adress to [url]www.playok.com[/url]. My problem depends … |
I have an assignment to submit tomorrow. It gives me compiling errors. About 62 in VC++ 2008 and 42 in VC++ 6. I have written this code in one single file and it works fine there. One error that I can think of is with the declaration of class variable … |
|
According to this: [url]http://www.parashift.com/c++-faq-lite/templates.html#faq-35.13[/url] One way to keep only the function declaration in the .h file is to do this [code] ////////// file: Tools.h #include <iostream> #include <vector> using namespace std; template <typename T> T Sum(vector<T> &V); [/code] [code] ///////// file: Tools.cpp #include "Tools.h" #include <iostream> #include <vector> using namespace … |
|
Hello mates, i am pretty new to this forum.. i am a midrange c++ programmer. if i have to create an IDE in c++ that involves basic drawing tools, what should i learn and where should i start?? is it a big task? can anyone explain me or direct me … |
|
I am having trouble with this program which was solved before, but I am still having an issue with the final code. Here is the assignment prompt: Write a program that asks the user to order an ice cream treat. The user selects the type of ice cream, the type … |
|
so im starting the second half of my c++ class and we are getting into functions. are first assignment and im already stuck -__- the teacher gives us the code for above main so we just need to write the prototypes. heres my code so far (prototypes probably wrong) it … |
|
i have a class with 10 object and each object have a random position like (x,y) now i wand a code that do not put object in same position please complete my code [CODE] #include <iostream.h> #include <time.h> #include <stdlib.h> class chess{ public : chess(); private : int x; int … |
|
i have to do this, and my lecturer is such an ass asking us to learn it by ourselves. i have tried a code but it not working the way it is suppose to be. (Airline Reservation System) A small airline has just purchased a computer for its new automated … |
|
Hello friends.. I am an amateur programmer in TURBO C++ .. It is a very old version v3.0 ... I am beginner.. I wrote a very simple programme to find the largest ans smallest element in an array . . The largest element finding process is working finely .. I … |
|
I'm trying to read a Unicode file using std::wifstream. On wintel. [code=c++] #include <iostream> #include <fstream> #include <string> using namespace std; int main() { wifstream File("input.txt"); wstring Line; while(!File.eof() ) { getline(File, Line); wcout << Line << endl; } system("pause"); return 0; } [/code] And this is my output [code] … |
|
Hello, I have coded an overloaded += operator and it is giving me trouble. basic function of the operator is to add data to dynamically allocated class array which has 3 member variables. [code=CPLUSPLUS] ie. savings[i].accountNumber; savings[i].balance; savings[i].customer; [/code] I have managed to get the first part of the function … |
|
Hi I am using Visual 6 C++ and try to retrieve a member's all closed trades. i declare a string as below: char str[8000]={0}; But this declaration is ok and the program work fine if the member's record size does not exceed 8000bytes. In order to be able to retrieve … |
|
i want to solve the homework the quation of the home work the game of damca please i want it the day |
|
hey i have to make a program using win32 c++ and i need to get my hands on some information from the registry which i cannot find. the problem is i need to find information about the graphic card the pc is using and this software has 2 be ported … |
|
Hi i have written a code for concatenation of two strings by overloading the string operator. The program works fine but i don't understand the sequence of steps happening. [code][Use language = C++] #include <iostream> using namespace std; class String { int len; char *p; public: String () { cout … |
|
I need to create a Space Invaders kind of game and I have a demo I need to copy the main features from. The invaders have to be of at least 3 different types and they change color. So I figured the invaders are 3 child classes from a parent … |
|
Does anyone actually use the .hpp file extension for C++ header files? I've never seen it used, but I was just working with geany, and I noticed that it only syntax highlights C++ specific things if the file extension is .hpp (or .cpp, obviously, but not .h). So what's the … |
|
Is there a way to Alt-F4 programatically. It will be used to close another programs window that opens wich is the topmost form on the desktop. |
|
Hey, I need help getting this program to run. This is what I'm trying to do. a) set and store the first name only b) set and store the last name only c) store and set the middle name d) check to see if a given first name is the … |
|
I am new to C++ although I have done intermediate java programming. A couple of months ago I bought a book called [I]The C++ Programming Language; Third Edition[/I] by Bjarne Stroustrup. I am beginning to think that was a mistake because it is a little over my head. I was … |
|
I'm trying to run my program and when I enter say 3 it gives me a fatal error. It is suppose to calculate the avg of each value entered and output it. Would appreciate a little advise on this I'm stumped. The error says "warning C4700: uninitialized local variable 'sum' … |
|
Ok I have a simple question I have a header file that has the following code [CODE] void setPartDecription(string partDescrip); string getPartDecription() {return partDescription;} [/CODE] Of course I have other functions but these are the problem functions and they are public. In my main function I have this: [CODE] cout … |
|
Suppose I were to use a code in my program very similar to this one: [url]http://www.codeproject.com/KB/IP/ftpclientclass.aspx[/url] What headers would I need to use? The tutorial doesn't state that, I downloaded their sample source codes for the compiler I use (Bloodshed) and none of the multiple example source codes' headers worked … |
|
Q) Draw an inheritance hierarchy for class Quadrilateral, Trapezoid, Parallelogram, Rectangle and square.Use Quadrilateral as the base of the hierarchy. Make the hierarchy as deep as possible. Can anyone help me to create it as a proper program? |
|
Hi There! Quick, probably dumb question but I have the following snippet [code] template<typename T> class Natural : public ArbitraryNumber{ std::vector<T> mVal; std::vector<T>::iterator mIter; [/code] instantiated with [code] math::Natural<long double> z; [/code] in my main module. Visual C++ dislikes this. When I put this in: [code] typename std::vector<typename T>::iterator mIter; … |
|
|
Someone out there please help me i must do a function for a bucket sort but i dont know how and the only things i must use are normal arrays and pointers no strange functions and libraries i need the code in c++ please i know what the program does … |
As I was busy inlining some of my functions, I was wondering if it is really necessary to inline anything. Doesn't the compiler automatically inline stuff, or do I have false memories? And if the compiler does inline stuff for me, would it be best to let it do its … |