49,761 Topics

Member Avatar for
Member Avatar for triumphost

I have the following code which finds a window by a partial name given.. I've tested it and it doesnt work in Dev c++ but it definitely works in visual studio 2008.. So I decided to make a form with nothing on it and implement this code to see if …

Member Avatar for triumphost
0
325
Member Avatar for SSully

So simple problem. I need to have a division by zero validation in my constructor in this class. It is painfully simple, but I am just starting to learn classes and I just cannot figure out what I have to do. Would it be easier to just put the validation …

Member Avatar for Kanoisa
0
257
Member Avatar for stereomatching

Sorry I don't know how to express it in English, so I use some codes to show what I am trying to say [code] template<typename strategyOne, typename strategyTwo, typename strategyThree> void someCode(strategyOne stOne, strategyTwo stTwo, strategyThree stThree) { //some codes stOne(some args); //some codes stTwo(some args); //some codes stThree(some args); …

Member Avatar for stereomatching
0
119
Member Avatar for HitnBooks

Hello everyone. I'm teaching myself C++ and I've found this lesson online on passing pointers. I've got most of it down, but two of the functions for the program aren't displaying right. Would you wise (experienced) ones have a moment to look at just these functions? Are they looking wrong …

Member Avatar for venomxxl
0
144
Member Avatar for Kanoisa

Hi all, I'm currently thinking about how to make a thread safe queue. Specified as such: [LIST] [*]Single reader [*]Multiple writers [*]Dynamically sized [*]Suitable for both a reader sleeping on a queue or as a polled queue [/LIST] So what I'm looking at so far (pseudo)code wise is the following …

Member Avatar for Kanoisa
0
642
Member Avatar for veda&&

[B]i need help i wanna know how can i pass am array of objects to the constructor header & the .cpp implementation ? & prompt the user to enter the values to fill it ? & how to pass it if it's array of int & its multi dimension ?[/B] …

Member Avatar for jonsca
0
222
Member Avatar for DarKKendO

Hi Guys, First post on here :) I've been here before and i've usually been able to find what I needed but now I'm in a bit of a bind. I'm doing a piece of coursework for my university course and i've just hit a huge brick wall. Basically what …

Member Avatar for DarKKendO
0
101
Member Avatar for Buffalo101

Hello, My program looks something like this: [code=C] char *name= (char *)malloc(200); unsigned char type=1; unsigned char GetType(){ return type; } char* GetName(){ return name; }; void function(unsigned char* message, int* intPtr){ message[0]= GetType(); // works correctly // CODE HERE } void main(){ unsigned char *message= (unsigned char *) malloc(256); …

Member Avatar for gerard4143
0
398
Member Avatar for c++prog
Member Avatar for fadi_1234

can anyone explain to me : what is counter++ and ++counter and the different between them ? and static_cast <type_id> (expression) and setiosflags ( ios::fixed | ios::showpoint Thanks

Member Avatar for fadi_1234
0
86
Member Avatar for cornedor

Hello, I am creating an console application for windows. I have set bufferSize and consoleSize so you dont have the console. If a set the cursor position at the very bottom right position the window scrolls down. Is it posible to stop this? Greetings Corné

Member Avatar for jonsca
0
120
Member Avatar for SWEngineer

When trying to run a simple `Qt program`, I get the following erros: (How can I solve them?) [CODE]In function `WinMain@16': c:/Qt/2010.05/qt/lib/libqtmaind.a(qtmain_win.o)[/CODE] [CODE]error: undefined reference to `_Unwind_Resume: C:\qt-greenhouse\Trolltech\Code_less_create_more\Trolltech\Code_less_create_more\Troll\4.6\qt\src\winmain/qtmain_win.cpp:93[/CODE] [CODE]error: undefined reference to `_Unwind_Resume': C:\qt-greenhouse\Trolltech\Code_less_create_more\Trolltech\Code_less_create_more\Troll\4.6\qt\src\winmain/qtmain_win.cpp:135[/CODE] [CODE]error: collect2: ld returned 1 exit status[/CODE] Thanks.

Member Avatar for jonsca
0
131
Member Avatar for fibbo

Hey, it's me again. Again with a topic that has been covered here but reading through the old threads didnt help me to solve my problem. And I am pretty clueless at the moment. Consider the class passenger_queue with 2 functions, namely: [CODE]int passenger_queue::get_passengers_waiting() const { // Insert your code …

Member Avatar for fibbo
0
7K
Member Avatar for jam45

[CODE]#include <stdio.h> #include <math.h> #include <stdlib.h> int main () { int dice1; int dice2; int roll , count,counter ,a ; int long doubles [13] ={0}; float frequency=counter+100000000 ,c; float percentage=frequency/100000000, d; dice1 = rand() %6 + 1; dice2 = rand() %6 + 1; for (int roll = 1; roll <=100000000; …

Member Avatar for WaltP
-1
132
Member Avatar for LevyDee

Im pretty green when it comes to designing a large scale application architecture, and have a question on the way I should go with it. Just for an example, to ask the direction I should take my design in, consider this: A parking lot manager has control over everything that …

Member Avatar for mrnutty
0
125
Member Avatar for floatingDivs

Hi Daniweb, I'm looking to read in a file, but "ignore" the label prefixed to data. For instance, if I have the following on one line, I want to ignore "Cities:" but read in the rest. [code] Cities: Chicago, New York, Atlanta [/code] If someone can point me in the …

Member Avatar for LevyDee
0
121
Member Avatar for nssltd

Hello, Hi i have been just looking at C++ games programming and i have bought a book and learned the basics of C++ aswell as some indepth games programming. I have been thinking of developing a small game with physics and stuff but for physics i'd like to use the …

Member Avatar for DarKKendO
0
139
Member Avatar for Jennifer84

Hello I read in alot of text into a Memorystream. Now I have to find a way to write this stream a chunk at a time to the text file. I have outlined the code that will not work in this case. As seen I do read in chunks of …

0
79
Member Avatar for lilbenji25

Hey, i know you are all probably very bored with the infix to postfix program and its many incarnations but i seem to be having a problem getting the linked list we have to use as a stack to work. More specifically; pushing to the stack, reading from the top …

Member Avatar for nezachem
0
194
Member Avatar for TailsTheFox

Hello, So I get MS visual studio 2010, and the first thing that I find, is that after a whole lot of trouble, I finaly get the tools to appear, and they're all greyed out. Screenshot attatched I think the problem might be: [list] [*]I'm using the trial [*]The file's …

Member Avatar for TailsTheFox
0
77
Member Avatar for andimiami

I need to write a program for class that calculates student averages and quiz averagages. It has to read a 2-dim array from a file that looks like this: 10 10 10 2 0 1 8 6 9 8 4 10 The four students are the rows and the three …

Member Avatar for andimiami
0
160
Member Avatar for sergent

I am trying to allow user to input something while there is time so I took a function sleep() that I found somewhere and changed it for input. Well, it doesn't work. [CODE] char sleep(clock_t wait) { char c; clock_t goal; goal = wait + clock(); while(goal > clock()) { …

Member Avatar for sergent
0
2K
Member Avatar for Christoph928

I'm relatively new to this and need help counting the number of times a user provided word appears in a user provided file this is what I got:[CODE]#include <iostream> #include <fstream> #include <string> using namespace std; int main() { ifstream infile; string str, filename; int count, num; count = 0; …

Member Avatar for bharathmakawana
0
173
Member Avatar for amna masood

This is my code:[CODE]#include<stdio.h> #include<iostream> #include<string> #include<conio.h> #include<fstream> using namespace std; class TESTnonteaching { private: string oname[3]; string osir_name[3]; int oid[3]; public: int count3; void TESTadd(); void TESTsearching(); //void editing(); //void TESTdisplay3(); void TESTsetcount3() { count3=0 ; } }; //ADDING STAFF// void TESTnonteaching::TESTadd() { if(count3>=3) {cout<<"NO SPACE LEFT"; return; } …

Member Avatar for redmaiev04
0
174
Member Avatar for magravis

Hi, I'm trying to write this program where there is: (1) a greeting (2) make columns (3) have a stored text file input into the program automatically The file is like so: NOT 11010011 AND 10010010 etc. (4) read the first word and then output it (5) read the first …

Member Avatar for magravis
0
114
Member Avatar for stereomatching

my compilers::tdm gcc4.5.2 my os::windows xp sp3(32bits) boost 1.45 Sorry, I have another problem again [code] template<typename accStrategy = float> int const adaptSR(int const MAX_AL, float const CONFIDENT_LV, int const OFFSET, accStrategy PLAN) { return 1; } template<typename accStrategy = float> int const adaptSR(int const MAX_AL, float const CONFIDENT_LV, int …

Member Avatar for stereomatching
0
361
Member Avatar for stereomatching

As I know, perfect forwarding is design for reducing the need of many overloaded functions when you pass the reference to the function and pass those reference to another functions Besides, to fullfill the objective of perfect forwarding && should be able to swallow the lvalue and rvalue That means …

Member Avatar for stereomatching
0
106
Member Avatar for Danny1994

Hello guys, im using this function : [CODE] //All Includes of my project #include <windows.h> #include <iostream> #include <fstream> #include <string> #include <direct.h> #include <urlmon.h> if (!File::Exists("c:\\MySettings\\Items.txt")) { URLDownloadToFile(NULL, ("http://download1225.mediafire.com/x6i9klhsm3dg/q6z21pgg9t5t6dn/Items.txt"), ("C:\\MySettings\\Items.txt"), 0, 0); }[/CODE] And i get a compiling error : [I]Unresolved external symbol ""extern "C" long __stdcall URLDownloadToFileA(struct IUnknown …

Member Avatar for Danny1994
0
2K
Member Avatar for ziggystarman

Hi been using the following code to close an external program. [CODE]ShellExecute(0, L"open", L"taskkill.exe",L" /f /im program.exe", 0, SW_HIDE);[/CODE] However once in a while I get the dreaded windows blue screen, not sure what to make of the mini logs it produces. One suggestion on microsoft's site is that it …

Member Avatar for ziggystarman
0
178
Member Avatar for shuzay8

hi everyone, i'd like to know of any websites or software that helps in c++ flowcharts. thank you

Member Avatar for jonsca
0
92

The End.