49,761 Topics

Member Avatar for
Member Avatar for FriXionX

As in, if you had an if statement, for example: [CODE]if(endProgramChooseType != 'y' || 'Y' || 'N' || 'n'){ (code for exiting program) }[/CODE] How would you do that in a switch statement? without doing [code]case 'a': case 'A': case 'b': case 'B': case 'c': [/code] etc.

Member Avatar for FriXionX
0
6K
Member Avatar for sDJh

Hello altogether, I am supposed to work through a project written in C++ and QT for Windows platforms. Now I am not an expert in window-related stuff. I installed MinGW 3.4.5 and QTSDK on Win XP SP3. I am using the tool "qmake" to create a makefile with all dependecies …

Member Avatar for sDJh
0
316
Member Avatar for Nelli71

Hello all amatuer user of C++ please help me recode this the question is this: The function String_To_MDY() assumes the user correctly enters the date in the form mm/dd/yyyy. Recode this function to include the following test. Test the string ensure the user enters two digits, followed by a slash, …

Member Avatar for Nelli71
0
158
Member Avatar for termin8tor

Hey all, I've been programming an ISBN system of sorts and I'm a little stuck (again). I want to output my linked list to a text file, so I setup the code like this: [code] void saveList(char fileName[40]) { for ( list< Publication* >::iterator it = pubList.begin(); it != pubList.end(); …

Member Avatar for termin8tor
0
265
Member Avatar for evilguyme

hey guys! im just so frustrated with this error .. more like a bug though heres a link to all my code on google docs [URL="https://docs.google.com/document/d/1JxrZtbBJ8RPpMvuXvi767Y4gBSiXmKauNu7RApHNVbg/edit?hl=en_GB"]Source[/URL] the bold and enlarged stuff is whats causing the bug problem is when i add [ICODE]void Platform::set_clips(SDL_Rect platClip[], int i)[/ICODE], i guess something in …

Member Avatar for evilguyme
0
118
Member Avatar for Oinkertop

I'm currently developing a game (And no, just because that's the case doesn't mean this belongs in game development), and I've run into a problem. Basically, I need to generate a random number. The number needs to stay the same after it is generated once. The code is in an …

Member Avatar for Oinkertop
0
145
Member Avatar for Anuradha Mandal

I want to print a pyramid like this..... ***** **** *** ** * This is my code.....[CODE]#include<iostream> #include<conio.h> using namespace std; int main() { int i,j; int b; char* sp=" "; cin>>j; for(int a=j;a>=1;a--) { for( b=a;b>=1;b--) cout<<"*"; cout<<endl; for(int k=1;k<b;k++) cout<<sp; } getch(); return 0; } [/CODE] But it …

Member Avatar for Anuradha Mandal
0
104
Member Avatar for Steven9999

Hello all I have a project written in C + + On the platform Windows XP I want to convert the text to voice How can I do that? ? Are there functions In audio/ sound libraries convert the text to voice??? I hope you help me

Member Avatar for Steven9999
0
118
Member Avatar for ChaseRLewis

I get this warning and I can't seem to figure out what it is referring too (it repeats this exact one ALOT when i have very little code). I'm trying to implement boost archive into my project as it allows less code to be written when serializing classes. [CODE] c:\program …

Member Avatar for vijayan121
0
223
Member Avatar for skorm909

So I've never worked with percentages in c++ and I was wondering how to incorporate into a program I'm making for a game so see what the chances are that an item will reach a certain level depending on the chance of success for each different level. Here's what I …

Member Avatar for raptr_dflo
0
143
Member Avatar for massivedynamic

I've recently started using PDCurses in a C++ game I'm working on. When I compile the program on my own machine (windows) and run the .exe, everything works as it should. When I take that .exe onto a different computer that doesn't have PDCurses and I try to run it, …

Member Avatar for raptr_dflo
0
864
Member Avatar for termin8tor

Hey all, I'm attempting to use an STL List to store a list of objects. Now I realise it's quite trivial to store a list of objects of my own definition. My real question is, how do I fill the list with objects that inherit from a base class. E.g. …

Member Avatar for termin8tor
0
269
Member Avatar for SecretDavidMAN

When I ask the user to enter in a number of games, Say I wish to do 5 fights. It runs the fight, then stops after 1 player wins. It doesn't loop back around, DO health levels need to be reset? I also think I did my coin flip wrong. …

Member Avatar for Raimucka
0
102
Member Avatar for Tauren

I am looking for a PKC library, I would like one that is decently fast. I have looked at RSA, but I cannot seem to find any decent libraries that would work. I will be encrypting packets that are sent out via UDP, however one client will have the private …

Member Avatar for nezachem
0
138
Member Avatar for evilguyme

hey guys i got one more question :O i have this code for a class function [CODE] void Platform::set_clips(SDL_Rect platClip[], int i) { for( int j = 0; j < i; j++ ) { platClip[j].x = 0; platClip[j].y = 0; platClip[j].w = random_number_w(); platClip[j].h = 5; } } [/CODE] is …

Member Avatar for evilguyme
0
88
Member Avatar for evilguyme

Hey guys! i just started using SDL engine to make a 2d game . This is the code ive got so far, you can view it online on googledocs via this link: [URL="https://docs.google.com/document/d/1S1upv5FxT3TvZsvhaZ1nFb39aUz-AVl7MhqP8zSZ4DM/edit?hl=en_GB"]CODE[/URL] i have made bold the code that causes the problem. when i do [ICODE]apply_surface(0, 0, stick, screen, …

Member Avatar for evilguyme
0
146
Member Avatar for Jennifer84

Hi, I have an URL like below. When typing that in explorer, that will let you download a .csv file. I simply wonder how you can do this in code instead. Reach the below URL and download this file to C:/ ? [code] string getURLfile = "http://ichart.finance.yahoo.com/table.csv?s=MSFT"; string savePath = …

Member Avatar for sergent
0
262
Member Avatar for bushh
Member Avatar for nuclear

So i just started learning SDL and came across "Event driven programming", just wanted to be sure if i understood the tutorial correcly. So lets say by adding: [CODE]SDL_Event event;[/CODE] i add lets say a container that keeps track of every event i do? After that i start using: [CODE]while …

Member Avatar for nuclear
0
282
Member Avatar for ameya1992

hello sir, actually what i want to do is to print a series of characters using outtextxy() function in c++ graphics. say my array contains '1','2','3','4','5'. using a for loop i want to print them at diff positions on screen. char c[]={'1','2','3','4','5'} int i,j=100 for(i=0;i<5;i++) { outtextxy(100,j,c); j+=100; } but …

Member Avatar for raptr_dflo
0
1K
Member Avatar for surajdevesan

hello guys, The file is not getting deleted in the function modify for some reason.....pls help!!!!!! pls do look at this code [CODE] #include <iostream.h> #include <conio.h> #include <fstream.h> #include <stdio.h> #include <iomanip.h> #include <string.h> #include <stdlib.h> #include <ctype.h> #include <process.h> #include <math.h> #include <windows.h> class car { int no; …

Member Avatar for VernonDozier
0
5K
Member Avatar for harryhaaren

Hey all, (Skip down till "Question:" if you're in a rush) Context: I'm coding on an audio application which involves storing buffers of audio. I'm currently using a [ICODE]std::vector<float>[/ICODE], as a member of an [ICODE]AudioBuffer[/ICODE] class. These [ICODE]AudioBuffer[/ICODE] instances are held in another class [ICODE]ResourceHolder[/ICODE]. In the "process" callback (where …

Member Avatar for harryhaaren
0
635
Member Avatar for Satteshlikes

This is part of a cinema project code that my friend did. I understand most of the other parts, but when I came to this part, I am completely lost. Can someone please explain this to me line by line please. Thank You. If you need the complete code to …

Member Avatar for WaltP
-1
168
Member Avatar for ksm092

This is my code: [CODE] stringstream str_number string description while(!str_number.eof()) { str_number >> str_description; if (str_description.length() < 1) { break; } description = description +" "+ str_description; }[/CODE] My problem is that if the description is more than one string, the last string is repeated twice. For example if the …

Member Avatar for nuclear
0
1K
Member Avatar for ksm092

This is my code: [CODE] for (i = 0; i < date.size(); i++) { str_date << date[i]; str_date >> newDay; str_date >> newMonth; str_date >> newYear; apptDay.push_back(newDay); apptMonth.push_back(intMonth); apptYear.push_back(newYear); }[/CODE] My problem is that the first date[1] gets saved nicely, however the second round of the loop it all goes …

Member Avatar for ksm092
0
108
Member Avatar for TheProgramer

How can i sort the Last Names?? i used the Last Name to be the head so the properties or some info will follow...need help bum bump [CODE]#include <iostream> #include <string.h> #include <fstream> using namespace std; typedef struct Student { char Fname[50]; char Lname[50]; char age[50]; char ID[20]; struct Student …

Member Avatar for Narue
0
218
Member Avatar for vergil1983

I have been given a question to write a program to read a number x from the user and then print the value of ln(1+x). I have been given the following equation to perform the calculation: [CODE] 1 2 3 4 5 6 100 ln(1+x) = x x x x …

Member Avatar for raptr_dflo
0
212
Member Avatar for clyo cleopas

[CODE] //A c++ program that calculate and print parking charges #include <iostream> using namespace std; #include <iomanip> const double minimumFee = 7.00; const double hourlyFee = 1.75; const int numOfCustomers = 12; const int numOfMinsPerHour = 60; void inputAndValidate(int&,int&,int&,int&); void convertToMinutes(int&,int&,int&,int&); void convertBackToTime(int&,int&,int&); double calcCharge(int,int); int entranceMinutes,exitMinutes,entranceTimeInMins,exitTimeInMins ; int minutesParked,parkedMinutes,entranceHour,exitHour,parkedTime …

Member Avatar for raptr_dflo
0
1K
Member Avatar for murnesty

[CODE]union _Test { unsigned char keydata[4]; struct _Member { unsigned char a; unsigned char b; unsigned char c; unsigned char d; }Member; }Test; Test.keydata[4]= { 1, 2, 3, 4}; [/CODE] error on line 12: expected expression before '{' token. If I declare without union, [CODE]const unsigned char keydata[NUM_KEYS]={ 2, 1, …

Member Avatar for L7Sqr
0
2K
Member Avatar for logan_231_2009

hey guyz.. I don't understand the REAL job of a controller in MVC pattern. Can anyone show me a simple program with the controller's code? thanks a lot

Member Avatar for Stefano Mtangoo
0
790

The End.