49,761 Topics

Member Avatar for
Member Avatar for muze

hello guys...Due to some reasons I need to pass a variable's address to MeessageBox(). I am using a function which returns a pointer to the item selected from combo box. Now I want to show this item's name in the MesageBox(). How can I do that? thnx``````

Member Avatar for muze
0
81
Member Avatar for mybluehair

I'm trying to say this: [CODE] string songLocation = "data/sounds/blabla.wav"; PlaySound(songLocation,NULL,SND_FILENAME|SND_ASYNC);[/CODE] but here is the error I get: [CODE]cannot convert `std::string' to `const CHAR*' for argument `1' to `BOOL PlaySoundA(const CHAR*, void*, DWORD)' [/CODE] Does anyone have any ideas? (btw, songLocation cannot be changed from a string. If that happens …

Member Avatar for geojia
0
127
Member Avatar for Glapsides

Hello people, Quick question. I am working on a mouse maze project, and I need help reading the maze into a dynamically created multi-dimensional array, called "maze". I have already implemented a working code as long as the type of "maze" is char. Below is the code for that: [CODE]bool …

Member Avatar for Glapsides
-4
116
Member Avatar for spooder weld

I'll try to keep this short. I'm writing a 2D platforming engine and I had good collision detection, but I had to add a separate condition for every platform I had. Essentially the collision function compares the sides of 2 rects. Here is a code snippet of the for loop …

Member Avatar for spooder weld
0
364
Member Avatar for mybluehair

I've got a chunk of code that opens up a txt file with 5 or 6 lines inside. I only need to grab the first line of the txt file and put it inside of a variable. The problem is that when I use this code, instead of grabbing the …

Member Avatar for Duoas
0
421
Member Avatar for ntaraaki

Can you please suggest an algorithm that uses pointers and I also have to read and save the text file, which I#m having trouble with. Here is a rough translation of the task into English(I used google translator so it's bit jumbled, my german's not that good): Define a structure …

Member Avatar for geojia
-1
231
Member Avatar for thisischris

[CODE]void DeleteMovie(vector<Movie> &M1){ cout << "Option selected: delete a movie from the database" << endl; string T1; int TT=0; if(M1.size()<1){ cout << ">Error: There are no movies to delete.<" << endl; } else{ cin.ignore(100,'\n'); cout << "Enter the title of the movie you want deleted: "; getline(cin,T1); for(int i=0;i<M1.size()+1;i++){ if(M1[i].Get_Title()==T1){ …

Member Avatar for thisischris
0
93
Member Avatar for thisischris

I'm having trouble with vectors. I have a class that I read from a file, then I insert it into a vector. It should work fine, but my compiler crashes every time. Am I not using the vector correctly? [CODE]#include <iostream> #include <string> #include <iomanip> #include <fstream> #include <sstream> #include …

Member Avatar for thisischris
0
98
Member Avatar for ntaraaki

Hi,everyone! I have to write a program that can find zip codes. I have to read the codes from a txt. file, so i have to use struct arrays In the main program, I just have to enter any random zip code and the program should be able to tell …

Member Avatar for ntaraaki
0
862
Member Avatar for bigman91

i have a problem getting it to display the average score of the players entered and also the player names and their scores for those that scored below the average. it works other than that. its late, ive been at this and another program for hours im probably not thinking …

Member Avatar for daviddoria
0
97
Member Avatar for claudiordgz

Hi guys I got a generic question (looking for a generic answer): I have to load a DLL into C++, I've been playing around all day with it trying to access the methods (I have a big manual for the DLL), so far I have tried the next: 1.- #import …

Member Avatar for claudiordgz
0
249
Member Avatar for BBustos

I would first like to start this post with a sincere Thank you to everyone who has posted and will post help for my problem. Without you guys, I would be banging my head on my desk. Well, I got another problem. This time with a function that takes a …

Member Avatar for sdeez_alpha
0
5K
Member Avatar for nanderv

Hi, I'm creating an rts game. I'm looking for a way to store unit data. I thought, I'll make a struct for all the required data, and make a multidemensional array of them (one dimension is the different players, the other is the units). The length in both direction is …

Member Avatar for nanderv
0
171
Member Avatar for indr

this is my header file.. sorted_list.h class sorted_list { private: class list_link { private: int key; // identifies the data double value; // the data stored class list_link* next; // a pointer to the next data public: list_link(int,double,list_link*); ~list_link(); }; class list_link* first; public: sorted_list(); ~sorted_list(); void insert(int key, double …

Member Avatar for indr
0
99
Member Avatar for MasterGberry

Not sure why I am getting it, I got this one other time and forgot how i fixed it.... Getting it when i am calling my functions in the main file (3rd) Three files to this code: [CODE]namespace SALES { const int QUARTERS = 4; struct Sales { double sales[QUARTERS]; …

Member Avatar for MasterGberry
0
152
Member Avatar for vbx_wx

[code] void* thread(void* sockArg) { TCPSocket* s = (TCPSocket*)sockArg; s->showUser(); return sockArg; } int main() { ServerSocket serversocket(4543); try { while(1) { TCPSocket* socket = serversocket.accept(); pthread_t pid; pthread_create(&pid, NULL, &thread, socket); pthread_join(pid, NULL); } }catch(Error& err) { err.what(); } } [/code] Why doesnt my s->showUser(); gets called ?

Member Avatar for mike_2000_17
0
85
Member Avatar for dnambembe

can anybody tell what's wrong with this code! //=========================================================================== // hybrid.cpp --this file implement the hybridlist class // Time-stamp: <2010-10-29 18:52:46 Dnambembe> // To compile: // g++ hybrid.cpp // Copyright (c) 2010 by Domingos Nambembe. All rights reserved. //=========================================================================== #include<iostream> #include<cstddef> //need NULL #include"hybrid.h" using namespace std; typedef NodeType* NodePtr; …

Member Avatar for dnambembe
0
126
Member Avatar for localp

I am new to conneting to MYSQL through a C++ code; so this is what i did i installed MySQL Server 5.1 (it was a EXE), and thats it. i opened the MYSql command line client and created a DB, and added a table and values to it. This is …

Member Avatar for aradicev
0
328
Member Avatar for samaniac

Hey guys, I have a really simple question that I doubt you'll find any trouble answering. Does any of you guys know where I can learn C++? What's the best website you know, and thank you.

Member Avatar for vijayan121
0
236
Member Avatar for alaa sam

hi can you tell me what type of data i should use to store a very large number like 500! (factorial of 500) thanks

Member Avatar for alaa sam
0
85
Member Avatar for geryin

Write a program which initializes two vectors, one of type integer, the other of string. Populate the string type vector with five strings (‘one’, ‘two’, ... ‘five’). Populate the integer vector with [ 5 4 3 2 1 1 2 3 4 5 ]. Write a function that empties the …

Member Avatar for jonsca
0
159
Member Avatar for StreetBallerX

well here is my problem i had a task to transfrom sequence of decimals entered by user to binary so i did it but here comes my problem it turn out that i MUST have used at least 2 functions 1 main for input output and 1 which contains the …

Member Avatar for jonsca
0
98
Member Avatar for Stefano Mtangoo

I know many will start with ODBC, but slow down ;) I have searched for ODBC and all I find is UnixODBC. Is this the same as ODBC? Also how stable it is? I will be happy to know some apps/companies behind it! I need support for MySQL, PostGreSQL, DB2, …

Member Avatar for Stefano Mtangoo
0
148
Member Avatar for MasterGberry

I am just learning how to work with multiple files instead of putting all my code in 1. When I have the delete lines that are marked it seems to crash the program. I must be over looking something simple here on why it is crashing. [CODE]// golf.cpp -- Definitions …

Member Avatar for Ancient Dragon
0
138
Member Avatar for MasterGberry

I am using Micosoft Visual Studios 2010 and reached a chapter in my book that asks for seperate compiliation. Up until now I have been using Notepad++ to write my code into a .cpp file and then used Visual Studio Command Prompt with a 'cl' command to compile the code. …

Member Avatar for Ancient Dragon
0
105
Member Avatar for vtothau

Like the title says, I'm having issues creating a tooltip for one of my controls in my dialog. This is what I have: [CODE] HWND CreateToolTip(int toolID, HWND hDlg, PTSTR pszText) { if (!toolID || !hDlg || !pszText) { return FALSE; } // Get the window of the tool. HWND …

0
45
Member Avatar for vavazoom

I'm working on a project that utilizes producers and consumers for an operating systems class. Each producer and each consumer will be its own thread. The producers will generate records that will be stored in a global buffer, in which the consumer will then access to use the data. I …

Member Avatar for mike_2000_17
0
273
Member Avatar for geryin

Write exactly four lines of code which declare one vector and one string (of any size and value you choose) and print their size to the console using a call to a member function of each variable’s respective class. I would write a sample but I dont really have much …

Member Avatar for jonsca
0
68
Member Avatar for newbee3

Hello, I need help on writing a C++ program that allow the user to input two values: a username and a password. Below is what I have so far to test the password and it is not working. #include <iostream> #include <string> #include <vector> using namespace std; int main () …

Member Avatar for chiwawa10
0
107
Member Avatar for tawes01

I'm using Dev-c++ to make a dialog-based app. I had it working, but now I am getting an error: An Access Violation (Segmentation Fault) raised in your program. I have narrowed it down to the winmain function: [CODE]int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int iCmdShow) { if (iCmdShow …

Member Avatar for tawes01
0
280

The End.