Beginners - September 2013 (Page 62)

Can I avoid reinterpret_cast in this example?
 
I'm trying to avoid adopting bad habits as I learn to program in C++. I've read that reinterpret_cast is best avoided because it turns one type directly into a...
[6 replies] Last: sorry my mistake. *'s are different than built in types. so to answer ... (by closed account Dy7SLyTq)
Does calling .size() in a for loop slow it down?
 
For example, iterating through a vector for (int i = 0; i < peopleKnown.size(); i++) // do whatever I know I could use iterators instead, but I...
[8 replies] Last: > Is the .size() function called every time the loop repeats or is it ... (by JLBorges)
compile to exe
 
I am using netbeans to compile my very simple program. when i try to run the exe on a windows machine it gives me a command prompt screen and then an error say...
[5 replies] Last: Not sure i haven't used netbeans but you could just use an ide and com... (by giblit)
loop breakdown
 
Hi there, i've been programming for 1 week now with C++. (my first ever programming language in fact). I've gotten as far as loops, and up until now have be...
[9 replies] Last: Oh, sorry I assumed you already knew about those. Yes, *= is equivalen... (by Daleth)
Is it possible to convert(copy) a 3D array to a 2D array?
 
The 3D array contains strings. And the strings must be copied into a 2D array in order. Is this possible? How?
[15 replies] Last: Thank you Andy. (by closed account yqD8vCM9)
by leo255
Rock, Paper Scissors using switch statement - What am I doing wrong?
 
Just trying to do a pretty simple Rock, Paper, Scissors game - Not sure what I'm doing wrong, but whenever I input '0', the game sort of works, but '1' and '2' ...
[5 replies] Last: Thanks guys...I actually initially only put the "break" at the end of ... (by leo255)
Program acting up
 
Hi, I'm new here, av got a troublesome issue, i'm creating a program dt accepts d NUMBER OF PANCAKES EATEN BY 10 PEOPLE, and orders them. I've created an object...
[2 replies] Last: Oh yes, u r rait, bt dts not d way it actualy is, i did dt so i wont h... (by A Chidera)
Help with Project
 
Hi guys, I am fairly new to programming in general and i am taking a C++ course here at my local college. the teacher has asked us to do this [Write an inli...
[6 replies] Last: Oh makes so much sense now guys, thank you so much i feel a little dum... (by NakidHoboe)
Errors in code
 
I dunno whats up with this code, it has errors but I look at it and cant find any, it gives you the length, last, and first number/letter of the input but it se...
[9 replies] Last: Just to let the others to see what the code looked like before edit ... (by Chriscpp)
Insert and Attach Functions for a Sequence Array Assignment
 
This is my constructor that I'm using: //PARAMETERIZED CONSTRUCTOR //sequence(int initial_capacity = DEFAULT_CAPACITY) //Postcondition: The sequence has b...
[9 replies] Last: Oh I forgot to initialize current_index in my constructor as 0. (by natekelsey)
What is the difference between * & and ->
 
I haven't programmed in about 6 years and I started in a class where I picked up where we left off 6 years ago, needless to say I'm rusty, and didn't really do ...
[5 replies] Last: These functions are primitive and shown only for demonstrative purpose... (by vlad from moscow)
.pro file in BlackBerry 10 apps development
 
I am learning BlackBerry 10 apps development and referring BlackBerry's documentation for this . I have downloaded their sample apps but in those projects I hav...
[2 replies] Last: The rest of the content in the .pro files are additional information n... (by OxBADC0DE)
Problem with my function
 
I have a weird issue, when I try and pull the return from my function it gives me a bunch of jumbled letters and numbers. I am obviously doing something wrong a...
[4 replies] Last: Try to avoid using global variables: Lines 4-6. Between curly brace {... (by giblit)
by Ed4434
Functions, passing by reference
 
Hey, just a beginner.. as the forum would imply! I'm just writing a quadratic equation solver and am wondering if someone could give me a few "pointers" on wha...
[12 replies] Last: Well.. if I, as the user, am inputting a, b and c myself, do I just pa... (by Ed4434)
Don't understand Bubble Sort in my code C++
 
Using vectors I have written a piece of code to display; 1. Total numbers of words inside a text file 2. Total Distinct words used in the text file 3. The X...
[3 replies] Last: Success! After adding the "correct" bubble sort code I was able to fi... (by loanrefi)
Vectors
 
Hello, I am still struggling to declare my vectors. I know there is an error around line 185 and I just can't figure out how to solve it. Also, my professor i...
[8 replies] Last: Feel free to re-reply in case you need more help making things private... (by S G H)
by Zexd
Overloading the <<
 
Hello. This chunk of code reports an error: In function 'std::ostream& operator<<(std::ostream&, const zv::date&)': error: 'int zv::date::day' is private ...
[6 replies] Last: Maybe you mistype std::ostream& zv:: operator<<(std::ostream& cout, c... (by tntxtnt)
Header guards and #pragma once
 
Hello I was making a program and had defined a file called Constants.h in it. When I tried to include it in main.cpp and in another class declaration pl...
[3 replies] Last: <snip> (half read the question before replying...) Andy (by andywestken)
by Ch1156
How to stop money from going over (1,2,3,4,5,6,7)
 
Ok so i have a game and in it you can buy stuff but when you do you can go over the price once then it detects you dont have anymore, i want it to detect it bef...
[135 replies] Last: Ok well i got it all working, thanks. (by Ch1156)
About Switch Statement
 
Can i use 2 or more expression in switch statement?? like.. switch(order1)(order2)(order3(order4)(order5) { case 1: cout<<"Large Pepperoni Pizza ...
[6 replies] Last: Rather than a switch statement, I think a list of strings would be mor... (by Gaminic)
September 2013 Pages: 1... 6061626364
  Archived months: [aug2013] [oct2013]

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