49,761 Topics

Member Avatar for
Member Avatar for goodi8u

Hello, I am new to posting, but have searched these wonderful forums for a couple years. I am programming a game as a hobby. And I have been searching for a way to read what the user types. e.g. User types in "hello" and I can take that and send …

Member Avatar for goodi8u
0
246
Member Avatar for cclausen7

I'm trying to make a deck of cards; I want it to keep track of the cards that have been drawn. Will this code delete the card that is displayed? [code] void Deck::draw_card() { int random_card = (rand() % cards.size()) - 1; cout << "\n" << cards[random_card].name << "\n"; cards.erase(cards.begin() …

Member Avatar for StuXYZ
0
71
Member Avatar for vbx_wx

[code] #include <iostream> using namespace std; class X { public: X(int) { cout << "X()" << endl; } void f() { cout << "f()" << endl; } }; class Y: public X { public: Y(int): X(1) { cout << "Y()" << endl; } }; class Z: public X { public: …

Member Avatar for mike_2000_17
0
103
Member Avatar for Mbot

Im getting the folowing error while trying to implement a friend function between two classes. "Board.C: In member function ‘void Board::input(bool)’: Board.C:227: error: ‘class Piece’ has no member named ‘castSpell’ make: *** [Board.o] Error 1" Piece's Header file [CODE] #ifndef PIECE_H #define PIECE_H # include "Spellcaster.h" # include <iostream> #include …

Member Avatar for Fbody
0
492
Member Avatar for indr

struct list_link { int key; // identifies the data double value; // the data stored struct list_link* next; // a pointer to the next data }; struct list_link* create(int key, double value, struct list_link* next) { return 0; } the "struct list_link" contains two variables and a pointer. what exactly …

Member Avatar for arshad115
0
121
Member Avatar for ayoitzrimz

Hi all, Thanks for reading my post! So up until now I've been using Emacs (or Aquamacs on my Mac - essentially the same thing) for software development and I really do find that I can work very quickly with it. Recently, I've been thinking that maybe there is something …

Member Avatar for ayoitzrimz
0
167
Member Avatar for Gramotey

Dear DANIWEB community members, I am a newbie with Windoze programming, and I hope you could help me going with my project as I have a really just a technical question: I have a simple GUI with some buttons and text boxes defined in a form .h file, and I …

Member Avatar for Gramotey
0
199
Member Avatar for mike42intn

im doing this project to work it prints out all information except the radius it just gives 0,0 but needs to give locations provided in code. [CODE]#ifndef SHAPE_H #define SHAPE_H #include <iostream> using std::ostream; class Shape { friend ostream& operator<<(ostream &out,Shape &s); public: Shape(double = 0.0,double = 0.0);//default constructor double …

Member Avatar for mike42intn
0
474
Member Avatar for aree

I am currently trying to write a C++ program. The intent of the program is to guess what side a coin is going to fall on, heads or tails. I feel like I am very close to making it work. But I can not seem to figure out how to …

Member Avatar for aree
0
2K
Member Avatar for TayKaye

I am needing help with programming challenge problem 12. It will compile, however, its does not make the array twice the size of the argument array. The problem says: Write a function that accepts an int array and the array's size as arguments. The function should create a new array …

Member Avatar for TayKaye
0
184
Member Avatar for Alexkid

Hi there, ok, im fairly new to c++ and have been trying to figure this out for ages: I have a text file i want to read in that contains lines and lines of lat long points; N50 42.22 W002 55.33 N50 42.22 W002 55.33 N50 42.22 W002 55.33 i …

Member Avatar for Ancient Dragon
0
196
Member Avatar for Lord_Migit

Hey folks, i have a problem with a vector im attempting to program. There are no compile errors but during run time i get an error saying: "Debug Assertion Failed! Program:...filepath\GA.exe File:...include\vector Line: 779 Expression: vector subscript out of range" etc... I have tried stepping throught the program to no …

Member Avatar for Fbody
0
671
Member Avatar for jessekoegler

Hello all, I am having a problem with a c++ assignment. The basic problem is that I have two functions -- one to compute the mean and and one to compute the variance of a subarray from a main array -- arraym.I keep getting an extra parameter in call error …

Member Avatar for daviddoria
0
827
Member Avatar for Ace1.0.1.

Looking for an intermediate c++ book; to give you sense of where i'm coming from. I just finish "c++ for dummies",which isn't half-bad. I made the mistake of getting Bjarne Stroustrup's book a bit too early. I was thinking of getting: Thinking in C++, Volume 2: Practical Programming and/or Practical …

Member Avatar for Ancient Dragon
0
146
Member Avatar for sharifyboy7

For my program I am supposed to implement an encryption and decryption algorithm. You will read the input from a file, “plaintext.txt” The file will contain plaintext strings that are all lowercase, and be of the format: 3 hello world 2 how are you Each line contains an integer as …

Member Avatar for sharifyboy7
0
251
Member Avatar for nayefc

Hello, I created a linked list and implemented a deep copy function. However, the copied list skips the head node in the source list for some reason. So assume source list contains the following data in their respective nodes: 1 3 6 7 10 312 The copied linked list will …

Member Avatar for nayefc
0
3K
Member Avatar for triumphost

SKIP to LINE 117 [CODE] #include <iostream> #include <windows.h> #include <fstream.h> #include <stdio.h> #include <stdlib.h> using namespace std; char n , p , m , L , F , E; int v , x , y , O , z , q , R; int main() { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14); cout<<"This …

Member Avatar for WilliamW1979
0
190
Member Avatar for jjspikejones

GENERAL DESCRIPTION A prime number is an integer greater than 1 whose only integer factors are 1 and itself. A right-truncatable prime number (or right-prime number) is a prime number that remains prime as each of its rightmost digits is removed. For example, consider the value 719. 719 is prime, …

Member Avatar for Fbody
-2
154
Member Avatar for koolman123

Well, please excuse my noobiness, and my little skill with C++, but give me a break, I'm young. Not for homework, just for the sake of being able to do it,I was trying to make a code for the Pythagorean theorem, and here is the start of the code (of …

Member Avatar for Fbody
0
221
Member Avatar for Zviri

Hi, I have a following problem. I have a number in string, for example "123456" and I'd like to convert it to int. This would not be a problem if I knew that the input number will always fit into an 32 bit integer. So if it won't I should …

Member Avatar for Nick Evan
0
340
Member Avatar for phfilly

Hey just wondering if someone could help me please with the following: board.h [CODE]public: Piece* Player1Pieces; Piece* Player2Pieces;[/CODE] (a section showing the initialization of the arrays) board.C: [CODE]Player1Pieces = new Piece[18]; Player2Pieces = new Piece[18]; char arrX[9] = {'a','b','c','d','e','f','g','h','i'}; for (int FootCount = 0; FootCount < 9; ++FootCount) { --->> …

Member Avatar for Fbody
0
274
Member Avatar for meazza

hello fellow programmers. I am having an anoying problem with a Contact book i am making. As the title of this thread suggests i am getting that error but only when i call for a specific function in the program called void search(). All the other functions in the class …

Member Avatar for meazza
0
285
Member Avatar for frogboy77

Hi, new to this so go easy. I'm trying to store a function i wrote in a file and call it with a header file rather than copy and paste as ive been doing but i keep getting error messages from the compiler. Can anyone point out what i'm doing …

Member Avatar for frogboy77
0
135
Member Avatar for Jsplinter

If I'm creating a new char[] to read in a text file: [code]char* pbuffer; pbuffer = new char[length]; [/code] what is the maximum size length can be? Would a std::string be better? pbuffer will only be allocated one time in scope no matter what, and length is not known until …

Member Avatar for Jsplinter
0
153
Member Avatar for jmcorpse

Hello, I have this probelm posted below. I pretty much have it figured out and it is still in rough draft form. I know it could be optimized better but, I'm not quite sure how to get it to look better. Although, the main reason I am looking for help …

Member Avatar for Fbody
0
100
Member Avatar for The Hisel

I have a machine that waits for short/long periods of time, and some data that I am writing to the server is being ignored during the transfer. If the machine waits for more than 10 minutes, roughly, I noticed 2 global variables aren't getting reported. The delimiters before and after …

Member Avatar for The Hisel
0
96
Member Avatar for sundip

Hi All Can anyone tell me about some good tool to auto indent the code c++/objective-c/c with some customization features.

Member Avatar for sundip
0
67
Member Avatar for rebellion346

Hey guys, so my assignment is making a program that takes 2 measure objects and multiplies them together and displays them in square feet. What I'm trying to do is convert the feet into inches for both of the measure objects, then multiply the added inches together. Then I'm trying …

Member Avatar for Nick Evan
0
144
Member Avatar for mr-smith

Interstate Motorway Pty Limited requires you to design a program that will produce, among others, customer statements for passing through E-way checkpoints of four toll stations (denoted by A, B, C and D respectively) distributed on the nationwide motorway. The charge of each pass is specified as follows Station A …

Member Avatar for Nick Evan
-2
193
Member Avatar for watery87

Hi guys, i just written a simple program which requires some date verification. However im facing some trouble with the input Problem 1: if the input has more than 8 chars, garbage characters gets printed Problem 2: if input contains invalid values(like negative), error gets printed Problem 3: if input …

Member Avatar for watery87
0
121

The End.