49,761 Topics
| |
Right now, I am learning how to use an Array. How the program should work is, I declare how many numbers I want to input, and then, put numbers in. At last, I can choose either find the maximum, sum, or product. The program seems right to me but it's … | |
Here is my project: Write a program that dynamically allocates an array large enough to hold a user defined number of structures (string name and three double tests). Using a function, the user will enter a name and 3 test scores for each element in the array. Using another function, … | |
Ok, so for this assignment, we were given a program and a class. We have to find where the program code needs modified and make the changes necessary to use the class. [CODE]/****************************************************************************** Programmer: Date: November 6, 2011 Compiler: Cisual C++.NET Source File: hw7.cpp Action: Reads words from stdin and … | |
Hi, I'm trying to make a set of monsters that have values that can be loaded. Like a Goblin having enemyhealth = 50, enemydamage = 15, etc. Here's what I kinda have an idea of doing... But I really have no idea how to use it. (File containing values for … | |
hey everyone.. i am a newbie to c++.. please someone tell me that how can i move different objects like circles, rectangles over the screen by using keyboard keys in Graphics mode? | |
I'm currently working on a implementing a matrix inversion method for a Matrix class in C++. One thing that isn't implemented is a check for when the pivot element is 0, meaning I will need to swap the rows (likely with the row just beneath it). Here is what I … | |
I have been trying to learn CSS for a while now. I have been working in C++ for quite some time now so i thought hey CSS should be a walk in a park but it has proved to be enormously difficult for me. The main thing that seem to … | |
This is the question: Define a function that takse a partially filled array of numbers as its arguments and returns the standard deviation of the numbers in the partially fille array. Since a partially filled array requires two arguments, the function will automatically have two formal parameters: An array parameter … | |
Hey folks, First poster here :icon_cheesygrin: So we got an assignment and part of it is, to write a stack with an array. So far so good, but I'd like to use a dynamic array that doesn't need the user to input any size. [CODE] void init() { int i; … | |
I have a program that is supposed to count the number of 'comparisons' during a selection sort. I'm having trouble trying to determine what a 'comparison' is considered! It runs the sort properly and sorts in ascending order, but I'm not sure where to put the comparison counter. I'm wondering … | |
I have a simple doubly linked list for a class I am in and I keep getting a seg fault on my last line of code, no matter what i make it. I can put a bunch of random couts and it will print them all then on the last … | |
Hello all , i have a small problem , i'm writing now a voting program , and i'm a little bit confused , how can i attribute the votes to a certain person? i mean , i enter the value 1 , and this vote must go to the first … | |
I have made a program to make a rectangle in a text matrix. It begins asking for width and height. The variable must be greater than 2 and a whole number. The only problem is if a user enters a character instead of a number, or a decimal instead of … | |
I am having trouble inputting sample data into an array and am wondering what I need to do to correct this? The input sample is like this: 3 7 9 3 8 2 10 11 4 14 This is the code I am using and is not working. The MAX_SIZE … | |
So I'm making a text editor with syntax highlighting. I'm subclassing richedit and using drawtext to overwrite(Exactly like in Iczelion's tutorials). I was trying to solve the highlighting part, and up till now, I've managed to paint over all of the text(no syntax discrimination). But I've run into a strange … | |
Boost provide us [code]is_base_of[/code] and [code]is_polymorphic[/code] Yet the dynamic type need to be deduce on running time What kind of situations would you use [code]is_base_of[/code] and [code]is_polymorphic[/code] to replace dynamic_cast? Thank you very much | |
Hello. I have a game with code like this. [CODE] class manualSetPosition{ public: Ogre::ManualObject * manualDebugger; void SetPosition( Ogre::ManualObject * manual, Ogre::Vector3 mousepos ){ manual->position(mousepos); }; }; [/CODE] Thats a class I use to draw a grid. I build it like this in my project. [CODE] manualSetPosition ManualSetPosition[1226]; [/CODE]this works … | |
I was wondering if someone could help me write the code for this... I have a text file with 10 lines, one word on each line and I am trying to get a word from a random line and then cout that word. Can anyone help? | |
Ok, I worked on my code so that I can repost it here. This is what it has to do. I also need a static cast which I am not sure where to put it. Thanks for any help!!!! Users should enter each number at an input prompt, then enter … | |
Create a class called “PROCESSINTEGER” for comparing two INTEGERS. Provide member functions input, isEqualTo, isNotEqualTo, isGreaterThan, isLessThan, isGreaterThanOrEqualTo and isLessThanOrEqualTo. The predicate functions simply returns 1 if the relationship holds true between the two Integers and returns 0 if the relationship does not hold. Also, provide a predicate function isZero. … | |
I am assigned the sort-of famous RMS assignment. This is what I have so far, it is just beating me. My biggest confusion is how to add the entries up. I think I will okay with squaring them, dividing the total and obviously the sqrt() at the end. [CODE]#include <iostream> … | |
hey all i am studying from a book,and i have to do an exercise. i dont want code or anything i want tip or someone explain me how to do it. i have a oldmast.dat file with some records a trans.dat file with records and i have to update the … | |
I have a base class and two derived class. One derived class which inherits base class as virtual and another one as non virtual. I have given below my codin. [CODE] // This program uses virtual base classes. #include <iostream> using namespace std; class base { public: int i; }; … | |
I'm looking at getting started with [URL="http://www.wxwidgets.org/"]wxWidgets[/URL]. I currently use Dev C++ as my IDE for C++ coding. wx Widgets looks very promising and could speed up my development if used. Though what the site doesn't state (at-least none that I've found) is whether it's an IDE of its own … | |
after vising cplusplus site and checking my book i havent found any example or explanation... so here it is: i have a function called "string stringreturn()" now inside i have INT LIFE , and INT NUM i would like to return the following "blabla bla (INT LIFE VALUE) bla bla … | |
Hey, im new to C++ forums and C++ for that matter. Im 16 years old and want to be a game developer so i made a calculator it took about 30min(a while i know but im a beginner) can someone tell me if what ive done is good code or … | |
I want to be able to launch a program using the system command that is located in the same directory as my program, is there an easy way to do this, without having use the getpath function and store it under a variable? Thanks | |
Here's me error:"invalid conversion from 'char*' to 'char'. This is much different than what I found on google because I'm using actual pointers not return values n' stuff. Well heres a watered down version of the code: [CODE]char* LOCK = new char[501]; char ret[501] = "this is fine in program"; … | |
Hi. I am currently writing a block of code to loop through a vector and generate all possible moves on a game. For my first for loop, this block of code never increments x. I even stuck an x = x+1 at the end of the block and it just … | |
Assalam u Alaikum! hey guys! can any one here tell me code of Nokia ringtone? or any other? thanks alot!! |
The End.