49,756 Topics
![]() | |
I am using Visual C++ 2010 express edition and i am making classes but when i run i get the error: 1>c:\documents and settings\louisa\my documents\visual studio 2010\projects\ninja wars\ninja wars\game.cpp(71): error C2065: 'm_pScreen' : undeclared identifier [ICODE] In my Game.cpp i have this code void Game::Draw() { Sprite::Draw(m_pScreen, testSprite, 0, 0); … | |
Hey guys I'm having a lot of trouble getting this program to work. I want to keep an inventory of different tools using a random-access file that shows the name of the tool, how many of each tool I have on hand, and the cost. I then want to put … | |
I am trying to write an algorithm to determine the average of a linked list of real numbers with the first node pointed to by first... ptr = first; while (ptr != null_value) { //not sure what to put in here } Can someone take a look of this short … | |
I am working on another linked list problem...really been struggling with this chapter dealing with lists...Here is the instruction for this example... Write an algorithm to search a linked list with the first node pointed to by first for a given item and, if the item is found, return a … | |
Hi there, quick (and I am sure) simple question on a program I have just created. here's the code: [CODE]#include<iostream> using namespace std; int main() { char letter; int counter=0;//set the counter to 0 for (letter=65; letter<=122; letter++) {if ((((((letter==91)||(letter==92)||(letter==93)||(letter==94) ||(letter==95)||(letter==96))))))continue; counter++;//increment the counter in the loop if (counter==27)//counter condition … | |
Hello daniweb forum members! Just a quick question which has hindered my programming greatly. I am creating an online role playing game: vorii - [url]http://www.youtube.com/watch?v=ePNxDlZ2H7Q[/url] And I have come across a problem with the chat interface. The way I have programmed my game is that each player as a place … | |
I can compile and run the program, but cannot output the text file and print the member list result. Anyone can advice the solution? Thanks. 1. Add new member information 2. Print member list 3. Exit #include<iostream.h> #include<fstream.h> #include<dos.h> #include<conio.h> #include<stdlib.h> #include<stdio.h> #include<string.h> #include<iomanip.h> struct student { char Stdid[7]; char … | |
hey guys/gals. i get a segmentation fault whenever the for loop in the print function is executed. any suggestions? im not sure what i did wrong. [CODE]//class member functions #include "experiment.h" #include <iostream> #include <fstream> #include <cstdlib> #include <iomanip> using namespace std; int Experiment::numberOfTests = 0; Experiment::Experiment(){} void Experiment::setExpName() { … | |
HI, i am Nishank and have got a project -to make periodic table by using the following a. Data Structure b. Object Oriented Programming in C++ c. Data File Handling through the program the user should be able to: a.view the periodic table b.edit the periodic table c.delete a record … | |
Im trying to access the objects in the vector array that ive created in the bid class. I need to access the first ask bid and then continue to compare the price and the quantity with the first buy bid. I dont understand how on EARTH im supposed access these … | |
Hai friends, Me too have some doubts regarding C++. What happens if a pointer is deleted twice? Which is a better option --pass by value or pass by reference ? | |
Hello guys, My problem is that my code will automatically go through: [code]if((ask[i].getPrice()) <= (buy[j].getPrice())){[/code] where ask and buy are vectors. I need to know how I am suppose to compare them based upon the getPrice()...... Thanks in Advanced. The rest of the code is here: [code] int i=(int)ask.size(); int … | |
Hey all, I've elected to write a console hangman game and I've completed it just fine. However, one thing is evading my logic as to why it wouldn't work. I want it to "appear" to LOAD GAME" at the beginning like so: "LOADING GAME....." The total wait time I want … | |
I have a class which accepts vectors from another class called trader. This is the simulator class: [code] #include<vector> using namespace std; class Simulator { Trader trader; Auctioneer auction; public: void run(); }; void Simulator::run() { trader.setBid(); auction.BidID(trader.getBidID(vector<int>)); auction.TraderID(trader.getTraderID(vector<int>)); auction.Quantity(trader.getQuantity(vector<int>)); auction.Price(trader.getPrice(vector<int>)); auction.Type(trader.getType(vector<char>)); auction.showbid(); auction.matchBids(); }; [/code] In these lines: [code] … | |
Hello, This summer I am looking into doing some research to enhance my undergraduate resume for graduate schools. The research that I am looking into requires that I have the ability to access and manipulate sound files (specifically music) so that I can perform statistical, machine learning and categorization algorithms … | |
This is a small program that is suppose to find out the sum of even numbers entered into an array.... but everything works fine without errors but the output am getting is a negative number.... -1717986920. [CODE]#include <iostream.h> void main() { int sum=0; int i, a[6]; int range; cout<<"Enter a … | |
Ok here is what I want... I want to read the Dictionary file, and output its contents into the dynamic-text.dat file... But it reads the dictionary file and it will not write to the dynamic-text.dat file and I have no clue why... what am i doing wrong.. when I split … | |
Hello, I cannot figure out why my program crashes when it gets to the code below. Everything else in my coding works, except when I go to run this code... [code] void Auctioneer::matchingGame(){ vector<Trader>::iterator it; int i=ask.size()-1; int x=0; int y=0; int bId; int tId; char h; int temp=0; int … | |
Assignment - read an input file that has month, highest temp for month and lowest temp for month. I have to use a function called GetData to fill the array. I define the array as 12 rows and 3 columns. Please could someone look at the code I have and … | |
Hi Would anybody be able to tell me if there is a book or any material ot there explaining what kind of widgets you can get for C++. I'm not sure what kind of widgets are available in terms of functionality. When I say types I mean say textbox or … | |
hey guys, this is what i have so far... this part is from the main.cpp [CODE]double x; cout<<"Enter a number to search for: \n"; cin>>x; list.search(x); if (list.search(x)) cout << "\n" << x << " IS on the list! AT POSITION :" <<endl; else cout << "\n" << x << … | |
i have this code and for an class work task and you have to do a walkthrough table and work out the output. But i dont know how you do a walkthrough table. Can someone help? [CODE] int c = 0, sum = 0; while (sum < 8) { c++; … | |
Hi there, I have written a simple program which I know a solution to, I simply don't understand why the version below doesn't work. I have investigated the answer to roughly how it goes wrong, I just don't know why! Where the problems begin is commented in the last six … | |
when you have 2 pointers pointing at the same address isn't it the-same as a reference pointer(*&)? | |
Hi everybody have not posted in a while. In all truth i am stuck but very close to finding the collision answer. Note 1 (Most of this skelton was premade for the assignment). Some variables i don;t even know what they do like Vy1. Incx, Incy. Stuff like the file … | |
Hello guys, I'm trying to get this employee class to work correctly and everything seems to be fine, up until the part comes where it should output all of the information (such as hours worked, hourly pay rate, gross pay, tax amount, and net pay). My program allows me to … | |
I am trying to make a list of array pointers, Is there a way that after declaring an array i can adjust the size? For example at start i create a array called : "list[2]" Is there a way that later on i can change "list[2]" and make it "list[3]" … | |
I have problem in reqruired output [B]the input is[/B] 333-0092-8868389 [B]required output is[/B] Country code is = 0092 City code is = 333 7-digit number is = 8868389 Phone number in correct sequence is = 0092-333-8868389 The full code is [CODE] #include<iostream.h> #include<conio.h> #include<string.h> #include<stdio.h> void main() { [COLOR="Red"]char ch,*str,*country,*city,*digit;[/COLOR] … | |
i'm a C# developer and new to C++. I have to learn about C++ due to my new Project. but no clear idea about Pointers.. therefore if someone who know about Pointers,please teach me them.. | |
So heres a portion of my program... the program has several functions (each doing diff. things) Im having a problem I can not find the way to write the sum of the third row in costOfSports array. the book says something like this: for(col=0;col<5;col++) { for(row=0;row<3;row++) { row_sum[row]=array[row][col]; } } … |
The End.