Beginners - August 2021 (Page 2)

by siid14
Duplicate Symbol for architecture x86_64
 
(from an old problem, I found a new issue that I did not expect) I have the following error (see ...
[4 replies] Last: I moved the L40 from rect.h to rect.cpp. Ty, it gives me an acceptable... (by siid14)
samples
 
Duplicate topic: http://www.cplusplus.com/forum/general/279580/ PLEASE learn to use code tags, th...
[1 reply] : not quite ┬┐is there a problem with .getord()? you misunderstood the ... (by ne555)
How to call void from a different class?
 
GUI.cc SomeClass::Dothing(); //A nonstatic member reference must be relative to a specific ob...
[1 reply] : First, minor terminology critique: You don't call 'void', you call a ... (by Ganado)
floating point numbers precision
 
Hello I'm solving some problem with doubles The numbers which I'm using are of order 10^7 I'm g...
[4 replies] Last: 240 lines is pretty small. Just post the code. (by helios)
confusion on unary_functions
 
//neccessary headfiles are included //"same" function class fun_with{ int operator()(int x)...
[2 replies] Last: fun_with is a type. You can't pass a type as a param hence the need to... (by seeplus)
by AkiraC
Favourite number in loop
 
Hi, I want to know how to "mark" the number as favourite number. Let say I enter number 2, and the ...
[3 replies] Last: Just a bit of defensive coding: When using any of the scanf functio... (by TheIdeasMan)
Passing pointers* to functions???
 
A little confused when it comes to passing pointers to functions? When you pass by reference &, the ...
[14 replies] Last: Just because a C++ program 'provides the expected output' in one situa... (by seeplus)
by AkiraC
How to trace output?
 
How to trace output of this program? I don't understand how to trace the output It shows 1 0 0...
[3 replies] Last: Use the debugger for your compiler. MS VS has an in-built one within i... (by seeplus)
Weird behavior when using stringstream
 
When I am using string stream twice it does not accept the value second time weird thing is same d...
[2 replies] Last: Thanks for the fast reply that was really helpful! Much appreciated!!! (by kalahan)
Blank output when entering negative numbers
 
Hi we've been given the task to create a program to find out if the number that has been inputted by...
[5 replies] Last: Correction: Modulo is implementation-specified for negative operands. ... (by helios)
polymorphism
 
Hi everyone, I'm trying polymorphism for the first time. I'm getting this warning when compiling the...
[13 replies] Last: I couldn't hope for better. (by Zhylian)
Divination Calendar/I-Ching Program
 
I'm going to say a bunch about what I am doing just in case maybe there is something easier I am onl...
[7 replies] Last: Jeeze, I was so excited I thought of a way to do it, I didn't see it w... (by zEcs Cilnt)
Error: expected primary-expression before ')' token
 
I have encountered a problem with my program. I want to receive a number from the user and then disp...
[3 replies] Last: The error is on L26. A for statement has 3 parts separated by ; (eg as... (by seeplus)
Scope resolution :: woes
 
This is a sample program that teaches us unions & structs. Structs are public access-specifiers by d...
[5 replies] Last: When you say "must be a namespace" you mean the name of functions/met... (by helios)
Password
 
Hi, I'm trying to figure how to read a username and password from a file using a map. I was able to...
[9 replies] Last: Seeplus and Andy thank you both for all your help. This all helps a l... (by kdrewes)
Retail Item (OOP)
 
Keep getting logical errors. Printing empty output Main File #include "RetailItem.h" #includ...
[3 replies] Last: See http://www.cplusplus.com/forum/beginner/279521/ Apparently OP did... (by Handy Andy)
for loop exits with out iterating
 
When the maskList() function is called in the "if" statement, the for loop gets bailed on, instead o...
[7 replies] Last: @spamfilter - see my 'fixed' code above re prime numbers. There is a p... (by seeplus)
Car Class (OOP)
 
Does anyone know why I keep getting logical errors in my code? Car.h #ifndef CAR_H #define C...
[6 replies] Last: Perhaps: #include <iostream> #include <string> class Car { int ye... (by seeplus)
Issues nesting enum within a struct
 
I am trying to nest some of my enums within structs so that I can use them in functions involving th...
[1 reply] : not having SDL, ... this works: const int LONGBUTTON_HEIGHT = 128;... (by jonnin)
Array - exeption thrown, stack around variable was corrupted
 
What the hell is with arrays, I thought I Am doing that correctly already, but apparently not. It is...
[6 replies] Last: You can pass an array to a function without it decaying to a pointer. ... (by seeplus)
August 2021 Pages: 1234
  Archived months: [jul2021] [sep2021]

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