49,757 Topics

Member Avatar for
Member Avatar for phalaris_trip

Hi guys, How do I pass arguments into into the constructor if I'm using new to creat an array of objects? So for example: CParticle* parts; parts = new CParticle[100]; parts is declared globally, but initialised later on in the code.. my lecturer suggested this strange syntax: parts = new …

Member Avatar for Duoas
0
2K
Member Avatar for DemonSpeeding

[code] if (decision == "B" || decision == "b"){ for (k =0; k < rows; k++){ for (m =0; m < cols; m++) switch (image[k][m] = image[k][m] + brightcount) { case '0' : cout <<" "; break; case '1' : cout <<"-"; break; case '2' : cout <<"="; break; case …

Member Avatar for Duoas
0
145
Member Avatar for Artis_Croatia

Hi to all I need help with this program, i have problem, i must write it out from left to right not from right to left, but i do not know how to do it, when i change something in program, than it is not working :( here is the …

Member Avatar for zandiago
0
91
Member Avatar for dabu

Shouldn't [I]continue[/I] in my [I]else[/I] statement return me to the top [I]do...while[/I] loop and print the following again? [code] #include <iostream> #include <string> using namespace std; int main() { double withdraw, deposit, balance, newBalance, amount; char ans; string choice; balance = 1000; cout << "Welcome to Whatever ATM!" << endl; …

Member Avatar for dabu
0
125
Member Avatar for Ccrobinson001

This is my first time posting an I need some quick help. I need to get this program to work for two players. once Player 1 loses Player 2 gets their turn. the program works fine just can't figure out the while loop for 2 player. [code=cplusplus] /* header files …

Member Avatar for WaltP
0
267
Member Avatar for AnthIste

hey there. my problem is pretty simple (i think). I dont know how to point at a multi dimensional array.how i understand normal array pointers is: [code=C++] int numbers[5]; int *p = numbers; //so now *p points to numbers[0] //so if you say: *p = 10; //is the same as …

Member Avatar for AnthIste
0
112
Member Avatar for aximenes

Conjunto is classtype that implements an array of pointers to some other class objects, i'm trying to overload the % operator so that the result is the join of both arrays into one. eg. array1%array2 = array1 + array2 im' trying to use methods of the class Conjunto such as …

Member Avatar for aximenes
0
199
Member Avatar for sanelisiwe

hello everyone,i'm new to classes but i have adapted well with it. i've been given this task and i'm left with three days to submit.i tried it myself but i just can't get it please help. this is the problem below. proram 2 MULTICHOICE VIDEO RENTAL SHOP needs an Object …

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

Hello guys help me with a code that hides a document say for example in my documents you can email at <snipped> if you get the code or anything about c++

Member Avatar for Ancient Dragon
0
95
Member Avatar for tom1989
Member Avatar for tracethepath

hello everybody... i am trying to make a project on binary files and that needs a function to modify data in a binary file. I have made the following class. [code] class example { public: char name[10], number[5]; void getdetails(); void showdetails(); example() { name[0]='\0', number[0]='\0'; } char* getname() { …

Member Avatar for WaltP
0
2K
Member Avatar for tom1989

How do i terminate a loop. i have written for(int i = 0; students; i++) but it keeps on going forever and will not stop.

Member Avatar for WaltP
0
111
Member Avatar for dabu

Can else have more than one statement? [code] if (control) <statement> else if (control) <statement> else { <statement> <statement> } [/code]

Member Avatar for vmanes
0
79
Member Avatar for people123

Hi, I am new to C++ and I joined this forum with hopes of learning as much as i possibly can about the language. This seems like a nice place with a mature community. I bought a C++ book and I'm just now learning the basics such as goto, for, …

Member Avatar for tracethepath
0
116
Member Avatar for mypopope

hi! smart people. It is my 11 days of reading and studying this book turbo c/c++, and I'm almost in the last part of the book. It is fun learning computer programming using c++. I'm having problem on how to apply the principles, that i've learned,so I need an example. …

Member Avatar for WaltP
0
235
Member Avatar for still_learning

I am looking to make a small program for a friend who likes to play roulette. I am looking to make a program that reads from a file which contains numbers (the numbers that come out in roulette) and then counts the amount of numbers that fall in certain groups. …

Member Avatar for tracethepath
0
106
Member Avatar for tom1989

Hi, i am having some trouble trying to finish my program! So far i have been able to load the data from a file into an array! Although now, what i cannot do is use this data. I cannot figure out how to use this data later in the program! …

Member Avatar for vmanes
0
89
Member Avatar for barbie 2

hi i am writing a program that counts words containing at least 3 different vowels using functions and also input files.i am confused here and don't know what to do.in this program i am to write another function that will output either 1 or 0 when a character is a …

Member Avatar for tostrinj
0
152
Member Avatar for Justmehere

I'm using Borland Command Line Compiler and want to use the regexp.h implementation of this header file. Where can I find all available functions and their definitions and maybe samples or examples of how they are used ? Thanks.

Member Avatar for Justmehere
0
126
Member Avatar for dabu

Hello. I wrote a program which works fine, all i need is to add one more thing. When I ask the user to input an answer (withdraw, balance...) I don't know how to prompt them if they enter something else, such as "golfball" and loop them back to entering the …

Member Avatar for Lerner
0
150
Member Avatar for blindkilla

Ok i have a file of names that looks like this: [code] john mary joe matthew [/code] im trying to use a for loop to store each name in a variable or string so i can use a for loop again later to output each name im pretty new to …

Member Avatar for WaltP
0
113
Member Avatar for dddave999

I would ultimately like to write my own OMR (Optical Mark Recognition) program. What language would you recommend is best to carry out this task.

Member Avatar for dddave999
0
328
Member Avatar for mister-fett

I decided to revive my (many months) inactive site today using things I've learned about C++ CGI and the Document Object Model along with CSS. The site is still down, but I'm trying to get back into CGI after leaving it alone for a while (also months). I've spent the …

Member Avatar for WaltP
0
415
Member Avatar for MedianHansen

Lately i've been having some problems, importing an SDL library, into my compiler, and as a result of that i have chosen to change to a new compiler. I have followed 3 differend online tutorials, re-installed the compiler three times, and done it with three different downloads of the SDL …

Member Avatar for people123
0
299
Member Avatar for weasel7711

I am working on a project to demonstrate the use of strings without using "strings" in the formal definition, as in using pointers to arrays of characters. The program is supposed to pick a string from an array of pointers to chars, but allow the program to include more words …

Member Avatar for weasel7711
0
2K
Member Avatar for cl3m0ns

I have a program that takes two separate arrays one of all the peoples names and the other of their test scores. I am not sure how to display the scores in a table view. here is my code so far [code=cplusplus] #include <iostream> #include <string> #include <math.h> using namespace …

Member Avatar for tracethepath
0
82
Member Avatar for zandiago

Good day. How do i convert the following code to C++? [code=java] // Lets import our file functions. import java.io.*; public class Grades { // Setup an array of test students private static Grades.test student[] = new Grades.test[50]; // Just for spunk we will create an inner class to keep …

Member Avatar for Ezzaral
0
177
Member Avatar for warpstar

Whats the difference between: pp = malloc(m*sizeof(int)) <--- I understand this and pp = **int malloc (m*sizeof(int)) <--- but not this ?

Member Avatar for Salem
0
138
Member Avatar for warpstar

The Function double *solve( double a[ ][N], double b[ ]) what does the pointer notation * represent in front of solve?

Member Avatar for Duoas
0
95
Member Avatar for SHWOO

I am trying to animate a bitmap in a window. I am able to load the bitmap in random locations multiple times, but I would like to have the previous instance of the bitmap erased each redraw, as I would like it to be a smoother animation instead of thousands …

Member Avatar for Duoas
0
229

The End.