48,986 Topics

Member Avatar for
Member Avatar for brodster89

I have to write a code where I tell the user to enter a sentence that has at least three commas. Then i have to print out each of the three words that appear after each of the first three commas. I am so lost and it is just introductory …

Member Avatar for VernonDozier
0
132
Member Avatar for Cindy_

Hello! First of all, sorry if my english sucks, it's not my first language >_< I want some help of you guys. I got a vector of dates named ListDate[i], and I want to do a search on it, to find the last days the user defines, for example: The …

Member Avatar for Cindy_
0
185
Member Avatar for BeyondTheEye

Using a windows forms application, most appropriate thing to use seems a listbox. Been searching around a bit, but I never found anything which seemed to explain it thoroughly. The idea is to load data from an XML file, and then display it in a list, presumably a listbox. Basically …

0
57
Member Avatar for Extreme

I need to make a program to check if the entered number is palindrome or not i.e. if u take a number and reverse it it will be the same old number for example if u take 121..then if u reverse the number it will be 121 and so 121 …

Member Avatar for Ancient Dragon
0
170
Member Avatar for nizbit

I have a class named SString, which is a user defined c style string class. The constructor for SString dynamically allocates a char array. Then I have a CD class which contains data about a specific CD, like artist, title, year, etc. They are defined as SString instances. I want …

Member Avatar for dougy83
0
133
Member Avatar for sirbriggs

This is a stripped down version of an error I'm getting in a different program, but this is simpler. The problem comes from if I try to set something that isn't an int in MyClass [code=c++]#include <iostream> using namespace std; template <typename T> class MyClass { private: T data; public: …

Member Avatar for sirbriggs
0
163
Member Avatar for brent.lozano001

I am trying to develop a code that will take a number similar to 8.23 or any number with a decimal and convert it to a whole number like 8. I would like to do this in an if/then statement but i dont know which process to call it from.

Member Avatar for dougy83
0
98
Member Avatar for Jennifer84

I think I have a convertingproblem when using stringstream. I multiply 0.995 * 19.99 wich is: 19.89005 The first messageBox do show because 19.89 < 19.89005. Then I convert Total to string and back to double again and do the same check if: 19.89 < NewNumber But here the MessageBox …

Member Avatar for Jennifer84
0
91
Member Avatar for unbeatable0

Hey there, I'm trying to use the SetSuspendState() function to hibernate the computer, but I have no idea what parameters I should send to it. The prototype is "BOOLEAN WINAPI SetSuspendState(BOOLEAN, BOOLEAN, BOOLEAN);" Since I'm a somewhat beginner in c++ programming, I don't really have an idea what BOOLEAN means …

Member Avatar for dougy83
0
528
Member Avatar for kux

This may sound silly. I have a class that contains a vector of pointers to instantiated objects. I want to return a refrence to that vector, but I don't want to be able to modify the vector through that refrence. Now, if i return a const reference, the vector is …

Member Avatar for dougy83
0
109
Member Avatar for kazek

I've been struggling with this program for few several days now.. It's an implementation of Data structures. I'm trying to use Linked Lists, Sorting and Searching concepts. [CODE=cplusplus]#include<iostream> #include <iomanip> #include <fstream> #include <cstdlib> using namespace std; class videoShopSystem{ public: bool empty() const; void displayMainMenu(); void menuChoice(int key); void addNewRecord(); …

Member Avatar for miepmuts
0
165
Member Avatar for zoner7

So I am using Dev C++ to compile this program; however, whenever I attempt to compile, I recieve a linker error that states, "[Linker error] undefined reference to '_cpu_features_init' ld returned 1 exit status" I googled the question, and people suggested that it may have something to do with the …

Member Avatar for dougy83
0
84
Member Avatar for coveredinflies

Hello, my understanding is 'this' is a pointer to the current class you are working in. Is this right? For example in my textbook it has [code] class ThreeD { int x,y,z; public: ThreeD() {x=y=z=0;} ThreeD(int i, int j, int k) {x=i; this ->y =j; z=k;} ThreeD operator+(ThreeD op2); ThreeD …

Member Avatar for vijayan121
0
183
Member Avatar for Emerald214

Excuse me, could someone help me? This code from an ebook and it isnā€™t wrong but it gives an error while being compiled. I donā€™t understand what error it is. error C2653: 'vector<int,class std::allocator<int> >' : is not a class or namespace name [code] #include<vector> using std::vector; int main() { …

Member Avatar for Emerald214
0
148
Member Avatar for mksakeesh
Member Avatar for cat08

Please give me the code as well as the algorithm for the following 3 questions, 1) To generate the following pattern using 'for' loop. 1 2 3 4 1 2 3 1 2 1 1 2 1 2 3 1 2 3 4 2)Write a program to take N array …

Member Avatar for Nick Evan
0
85
Member Avatar for grisha83

Hello, I am trying to solve an assignment in a book. It is asking me to write a program that takes a positive number with fractional part, which would round it to two decimal places. For example, 3.4256 to 3.43. Now, the thing that confuses me is that this past …

Member Avatar for vijayan121
0
103
Member Avatar for iamthwee

OK I was wondering what is the easiest way to do this? Let's say I have some arguments int main(int argc, char* argv[]) and argv[1] equals a c-style string. I want to change this to a std::string because I want to do stuff with it and I prefer working with …

Member Avatar for vijayan121
0
89
Member Avatar for kashifbhatti

Hi all, I want to created an MDI application in Managed C++.NET, which can use OpenGL. I have created an application VC++, which uses OnDraw function of CView class to render OpenGL drawings. But i am unable to find an alternate of CView class (actually some function like OnDraw which …

0
94
Member Avatar for paolomontero

Hello, Does anyone know which GDI API is called to draw menus and menu items on windows? I know its not DrawText, DrawTextEx, TextOut or ExtTextOut.

Member Avatar for marco93
0
133
Member Avatar for nizbit

I'm trying to call a member function inside a class but am having no luck. I need to find the length of the array. When I posted this code before there were some questions on the member functions. The reason those functions are private is that I don't want the …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for timelapse

I'm trying to create a program that will deal a random card, and I am VERY confused about how to go about making it. I understand arrays/strings in general but I have no idea where to start. My professor states that we will use the function rand() which returns pseudo- …

Member Avatar for VernonDozier
0
1K
Member Avatar for chunalt787

Hey does anyone have a basic binary multiplication function and or algorithm? I just need to record run times on it for varying amounts of input and don't want to have to spend an hour doing a solved problem for 5 points on a HW. Thanks in advance

Member Avatar for chunalt787
0
109
Member Avatar for kyosuke0

My goal is to read Olympic data into an array of structs. What i need to read in is the country code, and number of gold, silver or bronze medals that the country won. Also if one country won more than one medal, i am to just increment the information …

Member Avatar for kyosuke0
0
150
Member Avatar for PuQimX

I don't know to Write a full program that can display the following output: 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 1 2 …

Member Avatar for obj7777
0
109
Member Avatar for GamesSmash

Hi, I downloaded the 7-zip SDK from [url]http://www.7-zip.org/sdk.html[/url] I was wondering how to make it so my program could compress a folder using 7-zip. This is confusing for me because it is the first (maybe second) time I am using an SDK and it is hard to find instructions on …

Member Avatar for GamesSmash
0
167
Member Avatar for coveredinflies

Hi! I know alot of people try and learn C++ by themselves,and I am just interested to know how many people here have managed to become [B]good[/B] by learning themselves. Also would be interesting to know the general perception of self-taught programmers by profesionals is? Just for the record I …

Member Avatar for William Hemsworth
0
158
Member Avatar for coolcampers

Hi, I'm an input XML which I try to parse using C++. The problem is ^M characters get inserted at the end of each line and the parser errors out when it encounters ^M character. Can any one tell me how to replace ^M characters in c++ code? Thanks.

Member Avatar for Narue
0
2K
Member Avatar for Raija

Hi dudes! And thanks for reading this. So I want rand() to generate random number and again, but the second number canĀ“t be same as the first one. So far my code is: [CODE] int kortti1, kortti2; srand ( time(NULL) ); kortti1 = rand() % 5 + 1; kortti2 = …

Member Avatar for Narue
0
103
Member Avatar for Azurea

"They also don't allow goto. The problem with the three of them is that they disrupt the flow of the code for someone reading it. You are supposed to put everything into the conditions for the loop. It seems to me that there are times when a few continues or …

Member Avatar for Salem
0
93

The End.