Beginners - July 2015 (Page 6)

Called Function anomaly
 
Hey Chaps, I'm trying to get back into C++ and am finally adjusting to non-object-orientated code again... but I'm having an issue I can't find an answer too ...
[2 replies] Last: I structured the decision like you suggested originally but for some r... (by MrJuzah)
by fguy
Problem with getline()
 
When I execute the code below, I get the following... ISBN: 1234 Title: Author: I can enter an ISBN number no problem, but I don't get a chance to enter a tit...
[2 replies] Last: Thanks, I'm getting lots of mileage out of this one already. (by fguy)
by Ned757
I don't get the "Detect repeated words" program in Practise and Principles using C++
 
I've been over this chapter about an hour and I just can't figure out how this program works. I think I should just stop learning to program if this is how hard...
[10 replies] Last: Sorry for the late response. I don't think I changed from "=" to "==... (by xismn)
const int initializer for Vector within a class
 
Hi There!! I am trying to initialize a Vector within a class like this #include <iostream> #include <string> #include <cstring> #include <vector> u...
[2 replies] Last: Hi JLBorges!! Thank you very much for your answer! I will follow you... (by hebrerillo)
by fguy
enums and data input
 
Greetings. I am trying to get a handle on using enums. In particular I would like to set something up whereby a user could input data that would be used in a co...
[5 replies] Last: >Start with something simple - accept an integer from the user (0 for ... (by fguy)
Returning an pointer to an array safely?
 
So I have been trying to make a function that takes a sx, sy, and sz and then creates and returns an array of GLfloats that can be used by opengl. GLflo...
[4 replies] Last: CPATriangleVerticies() shouldn't allocate the array at all, it should ... (by dhayden)
"Segmentation Core Dumped" Not Using Pointers
 
I'm writing a program to create a 2D vector and randomly populate it with 1's and -1's. I'm attempting to use classes because I think later it will help a lot....
[1 reply] : Line 62 looks wrong. 1/2 is always 0 due to integer division. I think ... (by dhayden)
How to overlap Playsound()?
 
I am making a loop software thing where you can play multiple chip tunes over eachother. I am wondering how to do this with playsound(), I need to overlap the l...
[1 reply] : You can't. PlaySound() can only manipulate one sound at a time. You ne... (by Duthomhas)
Structs, Arrays, and Functions. Oh my!
 
I'm completely stuck on this assignment. I first wrote everything in int main() without any issue. It all worked lovely! Unfortunately our instructor wants it s...
[1 reply] : Whats this function doing. void setStruct() // I see no function def... (by Aim4Erudite)
Help with code
 
I'm having trouble getting this working. Here are the errors I get while compiling. Can someone please help me with these errors? LineSegment.cpp: In construc...
[2 replies] Last: Thank you for your help FurryGuy. I see the mistakes I made with them,... (by morgan9220)
Need Assistance Solving Errors
 
Hi. I'm new to programming, and I'm participating in a video course on C++. In it, there is a challenge to create a cash register program. It is not yet finishe...
[2 replies] Last: line 41 calls a function askForItem is written for char& and should be... (by closed account 48T7M4Gy)
by FMX138
Shuffling a vector of strings
 
I am trying to create a way to shuffle a vector of strings with out using the <algorithm> library. I am still learning about vectors but I have been struggling ...
[3 replies] Last: Thanks JLBorges and Duoas! It was just what I needed. (by FMX138)
by hutty
Search struct and return
 
Hi, I am trying to search a struct after I have loaded data via text file. I looking to look up a player and return his/her average scoring. I copied an onli...
[4 replies] Last: Okay...I think that's the answer I was looking for....Not that deep. I... (by hutty)
Getting sporadic segmentation fault (core dump)
 
Hi, When I debug in visual studio and step through every line of a function, there is no seg fault. But if I just step over it, there is a seg fault... If...
[4 replies] Last: There seems to be an error with __time64_t __cdecl _time64 It seems ... (by jjwooyoung)
Getting undefined reference to base class
 
Hi I'm getting "undefined reference to BaseClass::constructor()" whenever I try to compile. These errors don't pop up in visual studio, and I was wondering if ...
[1 reply] : Found the reason. I had forgotten to add BaseClass.cpp to my makefile.... (by jjwooyoung)
Stumped on a practice question for hours someone please help!!!
 
I am trying to get better at c++ so I'm practicing with some problems. This one is very hard for me since I'm still a beginner. heres the question: Define a c...
[9 replies] Last: ok thanks a lot! :) (by mchillington)
Help With Date Calculator?
 
Hello, I'm trying to create a date calculator in C++, though am running into quite a few issues, with my braces and primary expressions with the arrays in the p...
[12 replies] Last: Something else about your 3 functions, getMonth, isLeapYear and resetV... (by closed account E0p9LyTq)
by leourb
ostream operator << error
 
Hi to everyone! I am a novice programmer and I am studying Stroustrup's Book Programming: Principles and Practice using C++. I am now stuck with a code regar...
[5 replies] Last: You're right keskiverto, I read about C2679 and I have figured out thi... (by leourb)
by clodi
recursion isn't working why? (6 lines)
 
simplest question. WHY does this code crash? ('hello' is the vector: [1, 2, 3] with size 3.) int sumSquares(int p) { if(p == 0) { return hello.at(p)*hell...
[6 replies] Last: 'hello' is global because I generate the array in another function I... (by Gamer2015)
by Filorn
struct problem
 
This program doesn't print the right number i put. #include<stdio.h> #include<stdlib.h> typedef struct { char targa ; char marca ; char modello ; in...
[1 reply] : One of the first things you should take care of would be to use a cons... (by jlb)
July 2015 Pages: 1... 45678... 33
  Archived months: [jun2015] [aug2015]

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