Beginners - December 2014 (Page 15)

Why use friends?
 
I don't see the point in using friends in classes, they are not members, their scope is outside of the class, but they have access to the private data. So w...
[2 replies] Last: A class e.g School: has member data students and member functions teac... (by shadowCODE)
looping help
 
Hi, I've written the code below and everything works fine, but my question is how can I loop everything to ask the user if they wish to enter another set of pac...
[2 replies] Last: Something like this? bool userChoice = false; bool valid... (by Newie0001)
Program won't run, can't figure out what's wrong...
 
Hi I am C++ student, and have a test coming up tomorrow, and while writing this program I got stuck, since it wont run... if you guys could help me out it would...
[7 replies] Last: Thanks a lot dude! what a silly mistake I made. -_- (by matfizkenqim)
by leo255
Growable String Array - Getting Seg Fault
 
Hi all, As stated in the title, I'm just trying to write a class with a growable string array. I'm not worried about overwriting old words, and the unused inde...
[2 replies] Last: Thanks!!! (by leo255)
Search and replace
 
How would I be able to search for a number and change it in a text file? I looked through many sites and this forum and have not yet found something useful. Fo...
[3 replies] Last: int n1, n2; string str; get n1; get str; get n2; n2 += 2; write n... (by anup30)
New to C++, have no idea what I am doing
 
So, I'm really sorry if this is the wrong place, or a bad question, I am new here, and to c++. In my programming class, I am behind and am completely lost. What...
[3 replies] Last: I think the best way to tackle this is to look for patterns. Consider ... (by deathslice)
Next step in this program
 
So I've decided that the next program that I'm going to make is a traditional checkered board game. The first thing that I knew I had to do was to display the b...
[5 replies] Last: I think I much rather use loops seeing as though as this is a big grid... (by deathslice)
Random program crashes
 
I'm trying to figure out why this program crashes sometimes but then runs successfully other times. The program initializes a 2d char array in a grid pattern an...
[2 replies] Last: You're right, it does! Thanks! (by tylradm5)
by zanne
Need help with minimum spanning tree
 
I need to start program that counts from top branch wich is: 1, this program counts from 0, could anyone help? Here is the code : #include <iostream> #includ...
[1 reply] : I'm confused. It sounds to me like you are having trouble because your... (by Duthomhas)
by wolfv
polymorphism with template<>
 
I need help solving a compile error in the following code. I am trying to set an array size at compile time. Child class will be in a library, and the user woul...
[2 replies] Last: That was it! I always miss the simple things when it gets complicated... (by wolfv)
function called by main
 
Hi, I'm working on this program and I wanted to know if I was going in the right direction or not. How am I doing? is there something I should do differently? ...
[6 replies] Last: Thanks for your help :) (by Newie0001)
Randomly spawning on a map
 
Hi guys, I've been trying to get this piece of code to work but I'm hitting a wall I don't want to go and copy people's codes (as this is for my assignment and...
[7 replies] Last: i'm also still learning. it is one of those things that grows arms and... (by rafae11)
REALLY confused with class
 
Hello. I am learning about classes and I understand a bit on how they work: like functions, except in a much nicer and cleaner way. I am doing a programming ex...
[19 replies] Last: Yup, You're on the right track, given the assignment. Note that in the... (by dhayden)
Help please!
 
I just now started to learn this and i dont know why i cant get it to work please help //main.cpp #include "program.cpp" #include "header.h" int main () { ...
[3 replies] Last: If his topic is done CLOSE THE TOPIC ! (by jasonwynn10)
Want to output results from a Function
 
HI guys, after outputting the Function.. Its just after the switch Function List : //Describes, by printing out, the Monsters origin stats. //Function for ea...
[6 replies] Last: Cool, thanks for the pointers:) (by HarrySyson)
Random Number Gen. w/ Math Equations
 
I'm having many problems with my Homework . . I'm trying to make a code that generates 10 Random Numbers and then prints the Sum of all 10 of them, as well as p...
[1 reply] : (1) Use functions. Put all that stuff that fills Smith with random ... (by Duthomhas)
Does not name a type error
 
I'm using vectors in a class that creates different attributes for different types of units and I'm getting all kinds of errors like does not name a type, expec...
[7 replies] Last: Now that those technical issues are fixed I can focus on setting each ... (by deathslice)
using std::shared_ptr
 
Hello, I'd like to have a shared_ptr type object in a class , and one of the class' member functions should assign who the shared_ptr points to. In c...
[8 replies] Last: No, but you can write one yourself. For example, implementation for si... (by MiiNiPaa)
by AYQ
why does this if-function without else does not work
 
(Code was written in Visual Studio Express) The following function is called multiple times in a while loop. If m_nWaitToInitCounter, which is set to an int(e....
[4 replies] Last: Without the `else' you will be always executing the decrement. If the ... (by ne555)
Does this look right?
 
The program runs but what I want to know is if I did things that were unnecessary? or was there an easier way to write it? this was what I had to do: Write a...
[4 replies] Last: I get it now, thanks for your advice! (by Newie0001)
December 2014 Pages: 1... 1314151617... 55
  Archived months: [nov2014] [jan2015]

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