Beginners - December 2011 (Page 11)

Proper way to return from this loop
 
I'm not sure how to properly exit the loop after doing everything the function is supposed to do. The first 'if' in the for loop is where I'm stuck. I want to e...
[9 replies] Last: Updated: if (m_parse_success == false){ return *this; ... (by AndroidZ)
Can someone tell me why this function is executing twice?
 
It's the very last function, isalpha, in the substring.cpp file. It is only called once in main on line 82. substring.cpp #include "substring.h" #include <str...
[4 replies] Last: Your main function calls it twice. (Lines 82 and 89.) (by Duthomhas)
intro to c++, looking for some help
 
Just finish a semester of intro to c++ and I understand the basics of coding now. I'm making a menu program and I want to make the program loop to previous men...
[8 replies] Last: You're definitely on the right track. Your compilation errors can b... (by Stewbond)
strange error at ending of main
 
hi there is some kind of "Debug Error!" when i debug my program it's just a simple "MyString" class MyString.h - MyString class declaration //MyStrin...
[3 replies] Last: I still don't understand what that code is trying to do. Removing it f... (by Peter87)
by Maniax
function recursion
 
I'm trying to make a program that scrambles a sentence that the user inputs... Here's what I've got this far... #include <iostream> using namespace std; co...
[5 replies] Last: I'm thinking of a for function unless you have a function named for... (by Aramil of Elixia)
by oik
Posotion of the charachter in a string with an iterator
 
Hello! I would like to define a position of one charachter in the string using only an iterator. I have a function that takes an iterator and writes all cha...
[1 reply] : An iterator is not required to keep track of its location relative to ... (by Moschops)
Tic Tac Toe, find the winner
 
So I have a tic tac toe program in the works. My board is a single dimensional array like so: char board = {'1','2','3','4','5','6','7','8','9'}; It is dis...
[7 replies] Last: Oh yeah, sorry. For some reason I thought it was a 2D array! And I us... (by Lynx876)
how to give values to a double variable in header
 
I am writing a header in which I want to create and immediately give value to a double. What I programmed is: #ifndef ST_1_C_MN_H #define ST_1_C_MN_H #...
[3 replies] Last: Yo can put it there (in the declaration that is) only if it's const (a... (by eypros)
How to divide the even and odd number to their own array?
 
Im learning array right now the output display the numbers given but the memory put their own output to the data that have no input #include<stdio.h> ...
[10 replies] Last: 1 Why would you access evenNum and oddNum . You know that evenNum and... (by hamsterman)
How do I make a class instance a member of a parent class?
 
I have a class called world , of which I have 1 or 2 instances. Each of these classes contains a bunch of community class instances. At the moment I have the...
[4 replies] Last: Wow, you are going a bit crazy with the pointers there. You could desi... (by IceThatJaw)
Simple parsing function
 
I'm working within the isalpha() function, starting on line 221 of substring.cpp. I've started writing the definition, but I'm pretty sure I'm doing it wrong. I...
[1 reply] : substring.h // CIS-62 substring class #ifndef _CIS62_SUBSTRING_H_INC... (by AndroidZ)
What do I need to include for isalpha()?
 
Everything I've seen online isn't working. I need to use isalpha(char). For example: if (m_parse_success == false){ return *this; }...
[2 replies] Last: Got it, thanks. Just had to put std:: in front. (by AndroidZ)
Game Tile Map Question
 
I am working on a game tile map. I found this thread http://www.cplusplus.com/forum/general/18315/ very helpful! A few things were left out in that thread, ...
[2 replies] Last: Thank You! That is exactly what I needed. I am going to go with your... (by justcolorado)
Is this the right way to take out the garbage?
 
I am looking at my code, and I am not 100% sure if I created two free store arrays or one. Here is a simplified version that shows what I don't understand. ...
[2 replies] Last: Thank You! (by justcolorado)
Tic Tac Toe Help!!
 
Hello all!! I have a quick question I am making a tic-tac-toe console game and it somewhat works the only thing that doesn't is checking vertical wins. I think ...
[11 replies] Last: @coder777 Thank you!!! I finally understand what you mean. Oh my goodn... (by TheMassiveChipmunk)
Help with reading in data from a txt file to an array.
 
Every time I run the program it never prints the data from the txt file. Here's the code. Can some one help me out.\ //Assignment #8 //Cosimo Vilardo ...
[2 replies] Last: Does it print anything at all? Is infile successfully opened or not? (by Peter87)
Simple calculator problem
 
Hi guys. So, i'm trying to make a simple calculator. Right now i'm only making the addition(+) version. The program runs, but some how it gives me the wrong a...
[7 replies] Last: atoi and itoa are not the same thing. atoi converts a character to ... (by ReedTompkins)
Node and List
 
Hello, Im very very new at C++, I have this assignment that I can't figure out, if anybody could me, I'll be very grateful. Create a List class with the fo...
[1 reply] : You are very new to C++ but want to write a linked list? Have you ever... (by IceThatJaw)
c++ graphics
 
Write an application to show graphically the process of binary search tree insertion and any one of the following traversal using c++. a) B...
[2 replies] Last: What is your question? (by ReedTompkins)
cin.fail() with string
 
Am i correct in thinking cin can never fail when entering into a string variable?
[9 replies] Last: No - like Peter87 said if you create the ofstream object inside the if... (by exiledAussie)
December 2011 Pages: 1... 910111213... 47
  Archived months: [nov2011] [jan2012]

This is an archived page. To post a new message, go to the current page.