49,761 Topics
| |
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 … | |
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 … | |
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); … | |
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 … | |
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 … | |
[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] … | |
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 … | |
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); … | |
to find the no of times each word appears in a file | |
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 | |
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é | |
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. | |
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 … | |
[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; … | |
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 … | |
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 … | |
| 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 … |
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 … | |
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 … | |
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 … | |
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 … | |
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()) { … | |
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; … | |
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; } … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
hi everyone, i'd like to know of any websites or software that helps in c++ flowcharts. thank you |
The End.