49,757 Topics

Member Avatar for
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
831
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
245
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
97
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
147
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
Member Avatar for archduke83

hello, im just trying to translate a 1d TV denoising function for matlab, which can be found here [URL="http://cnx.org/content/m31292/latest/"]http://cnx.org/content/m31292/latest/[/URL], to C++. Here's my attempt: [CODE] inline vector<double> tvDenoising(vector<double> data, double lambda, int Nit) { vector<double> J (Nit); int N = data.size(); vector<double> z (N-1); fill (z.begin(),z.end(), double(0)); vector<double> diffZ (N-1); …

Member Avatar for archduke83
0
255
Member Avatar for adarbyem

Hi all, the search function failed to yield any results for me so I come here to create a new thread. I'm learning C++ on my own (sort of a weird hobby of mine to learn code, don't ask) and had an interesting question... Consider the following: Ingredients.h [code=c] #ifndef …

Member Avatar for adarbyem
0
273
Member Avatar for ahmad deeb

a program that prompts the user to insert a positive integer number and send it to a function that will prints all the prime number from 0 to this number. Hint: use nested for loops.

Member Avatar for jonsca
0
41
Member Avatar for localp

I need some help to write to a MySQL database using C++. any basic tutorial will be appreciated. I did google but couldn't find a beginner tutorial. I am sort of lost here. :(

Member Avatar for Isaac Remuant
0
79
Member Avatar for gpjacks

This is a program which declares two vectors of 6 elements each of type double. One vector is named weight and the other is named rate. The program uses a loop to prompt the user for a weight in ounces and a postage rate for that weight and then stores …

0
247

The End.