49,757 Topics

Member Avatar for
Member Avatar for kartik14

Hi, I would like to know the significance of lua methods beginning with an underscore.. for example __init().. Thanks !!

Member Avatar for kartik14
0
290
Member Avatar for Jiggle

I have a pretty basic knowledge of most concepts in C++ save some issues that I have surrounding polymorphism, and I just love the way it feels. But I have my first AS level computing lesson tomorrow, and it will be in Object Pascal. Will this actually be helpful, with …

Member Avatar for Jiggle
0
85
Member Avatar for Jiggle

In the S.D.L tutorial that I'm following, a pointer is declared at the start of the program, of type SDL_Surface, and assigned NULL. This is later assigned to TTF_RenderText_Solid(arguments...). Does this mean that SDL_Surface is the base class from which TTF_RenderText_Solid is derived? - I read something about SDL_Surface being …

Member Avatar for Jiggle
0
225
Member Avatar for robdb

I have to write an application which uses the Vigenere cipher with the Italian alphabet (only 21 characters, excluded J,K,W,X,Y). After a day of trying this is the code that I wrote [CODE] #include "vigenere.h" #include <string> using namespace std; Vigenere::Vigenere(string str){ key = str; key = StringToUpper(key); for(int cnt …

Member Avatar for raptr_dflo
0
420
Member Avatar for NetJunkie

Before I get started with this question I would like to point out that this is a small app I am creating to not only learn more C++ coding but also to choose who drives the fifth day in my carpool group for college. I am creating an application in …

Member Avatar for mrnutty
0
197
Member Avatar for valestrom

I was looking for an easy way to define variables for random monster encounters in my game. I'm not sure how to define some without typing out 1000+ lines of code for like 25 monsters. What I was wondering if there was a way to make a config file, or …

Member Avatar for mike_2000_17
0
239
Member Avatar for Vusumuzi

Here is the question: DECIDE YOURSELF The SuperShop have seven sales assistants. They are paid R55.70 per hour and 1.5 times for overtime. Each sales assistant is also paid 2% commission on his or her sales. The manager of SuperShop wants a C++ program to print the weekly payslips for …

Member Avatar for Ketsuekiame
0
90
Member Avatar for Desh2350

Okay, so here's my set of problems: I need a simple error check, so that if the user enters the wrong type of character, he/she will be notified and allowed to re-enter a new value. Secondly, I need some sort of loop that allows the user, after having running the …

Member Avatar for Ketsuekiame
0
250
Member Avatar for HelpStudents

Issue with how to properly use push_front and pop_front. I have a class named Account I am suppose to be able to be able to add new accounts and new balances but I can't find the proper documentation on how to do this. I am trying to figure out what …

Member Avatar for tajendra
0
383
Member Avatar for rjcenteno

okay i came up with some code that reads in a file, and on the file are names of shapes and their widths/lengths. after the file is read in, it tokenizes whats in the file, it then calculates what shape it is and then takes the information and calculates the …

Member Avatar for rjcenteno
0
180
Member Avatar for micheal Amirul

Dice Rolling Write a program that simulates the rolling of two dice. The program should use rand to roll the first die and should use rand again to roll the second die. The sum of the two value should then be calculated. [Note: Since each die can show an integer …

Member Avatar for WaltP
0
167
Member Avatar for hacknayan

can someone tell me how can i read data from text files line by line and store it on a variable. example: here is my the data in my textfile. example.txt Username: blahblah Password: wewewe my problem is how can i get the blahblah and wewewe and store it in …

Member Avatar for NathanOliver
0
106
Member Avatar for valestrom

I have a main c++ file with all my integer values, then I have a seperate c++ file with my algorithms for my battle function. May seem like a simple question, but how do I get the values from my main c++ file and use them in the other one …

Member Avatar for valestrom
0
77
Member Avatar for parth27987

I'm obviously a noob @ c++. Have a question. is there any way i can restrict user to input only numeric value and make a loop if user enters non-numeric value. for example for conversion from kilo to pound if user enters some garbage like "afshdgafg" in cin. is there …

Member Avatar for parth27987
0
235
Member Avatar for Satyrn

I am trying to simplify Maven to use one POM to do both a 64 bit build and a 32 bit build. I have tried to separate the build into two separate executions however I am required to set the compilerExecutable tag specified by the maven-native-plugin to point to either …

Member Avatar for Satyrn
0
368
Member Avatar for Vusumuzi

This is a simple one, but don't know why it won't work. Question VALUE RETURNING FUNCTIONS WITH ONE OR MORE VALUE PARAMETERS The pupils of the Annandale High School have to pay a fee for each extramural activity that they want to partake in. These activities include sport, and other …

Member Avatar for Mouche
0
246
Member Avatar for Coffee_Table

I am trying to determine the time complexity (and space complexity if anyone would like to have a go at it) of a sort function i implemented with a custom comparator. it is the sort function from the STL <algorithm>. First off, I am using Visual C++, so I am …

Member Avatar for Narue
0
589
Member Avatar for imraan1992

[CODE]#include <iostream> #include <conio> void main() { int n; cout<<"Enter value of n:"; cin>>n; if(n>=0)&&(n<=10) { { if(n==0) Zfactorial=1; cout<<"/t/tThe value of Zfactorial for n"<<Zfactorial; else(n>0)!!(n<11) for(int n=0;n<11;n--) Zfactorial=Zfactorial*(n); cout<<"/t/tThe value of Zfactorial for n"<<Zfactorial; } else cout<<"Invalid value of n"; continue } getch(); }[/CODE] [B]question[/B] Professor Zoe has come …

Member Avatar for gusano79
1
99
Member Avatar for coolbeanbob

Hello, I have been given an h file. Below is a section of the h file, with the entire h file below it. I am trying to figure out how to invoke the section directly under this message. [CODE]template <class T> ostream& operator << (ostream& os, const List<T>& s) // …

Member Avatar for coolbeanbob
0
198
Member Avatar for Rizi004

please help me i m having problem for making this program First Part: (Using Structures) Create a structure called Complex for performing arithmetic with complex numbers. Complex numbers have the form realPart + imaginaryPart * i where i = √(-1) Use floating point data to represent members of structure (i.e. …

Member Avatar for Narue
0
511
Member Avatar for valestrom

Hi, I wrote part of a program in visual c++, but I use dev c++ at school, so I tried just copying my code: [CODE]char mainmenu[50]; char game[50]; int strength; int intelligence; int dexterity; int health; int mana; int damage; int defense; int k; int roll; int experience; int levelup; …

Member Avatar for Fbody
0
201
Member Avatar for Hayzam Sherif

Hello Everyone I Have Been Learning C++ For The Past 1 Year :D , So With This Much Experience Can I Make or Modify A Bootloader in C++ Paradon Me For My Bad English Any Replies Would Be Greatly Appretiated

Member Avatar for Hayzam Sherif
0
178
Member Avatar for crapgarden

I have this code: [CODE]#include <iostream> using namespace std; int main() { enum foxtrot {green, yellow, red}; foxtrot colorSelect; cout << red << endl; [COLOR="Red"]cin >> colorSelect;[/COLOR] cout << colorSelect << endl; } [/CODE] Line 10 gives me the result 2 as expected, but line 11 gives me a compile …

Member Avatar for ashishseo
0
206
Member Avatar for srednakun

Hello, I am not sure why, when I call my method, it goes into a continuous loop and prints out nothing. The operator - method is suppose to be able to subtract a Date object and a Date argument. I will clarify if anything needs clarifying, thanks for the help …

Member Avatar for tkud
0
153
Member Avatar for murnesty

I having problem of sizeof returning a hexadecimal value which I want it return decimal here is my sample code: [CODE]#include <cstdlib> #include <iostream> #include "stringCascade.h" using namespace std; void StringCascade (void) { unsigned char ucA[] = {0x02, 0x6F, 0x09, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, …

Member Avatar for tajendra
0
132
Member Avatar for coolbeanbob

Hello, I am having trouble implementing the load function below. It compiles, but I get garbage in the array and 0's in the vector. The reason I created load() was to clean up main(). Do I need to open data.txt in main and then call a function to load the …

Member Avatar for raptr_dflo
0
178
Member Avatar for coolbeanbob

Hello, I am trying to implement a linked list with an h file that was provided to me, which I cannot change. I have created a simple main() to begin, but I am getting an error on line 40 of the h file that says... "template-id 'operator<< <int>' for 'std::ostream& …

Member Avatar for raptr_dflo
0
174
Member Avatar for vdsf

I'm trying to code a traversal function for a huffman tree that will generate the code dictionary containing the binary codes for each letter in the tree. Once it hits a leaf node I want to insert the character and a QBitArray into the QMap that I pass in. The …

Member Avatar for raptr_dflo
0
303
Member Avatar for MrAppleseed

Hello all... again, I'm trying to write a function that will "simulate" the stack. Here's what I have so far... [code=C++] int i = 0; int arraySize; char * stack[100]; void stackPush(char * pushed) { if(i == 100) { cout << "ERROR: Stack overflow!"; } else { stack[i] = pushed; …

Member Avatar for raptr_dflo
0
107
Member Avatar for valestrom

What I want to do is have a predefined battle function, I can code the function, all I need to know how to do is have the function sitting there, so when I call it, all it takes is one or two variables to set up and go. So every …

Member Avatar for valestrom
0
121

The End.