General C++ Programming - September 2017 (Page 6)

Which way is better? inheritance or member?
Which way is better? So, for example, let's say we have a game engine class through which you can add objects. But object manager class does that. So should I p...
Sep 16, 2017 at 6:27pm
[4 replies] Last: Thanks!!!! (by Putarda)
How to exit the program and and continue
include<iostream> using namespace std; int main() { float weight, height, bmi; cout<<"Enter weight in kg and height in metres"; cin>>weight>>height; bmi = we...
Sep 16, 2017 at 5:39pm
[3 replies] Last: Thanks. Understood how to do it.I will take care of that gaps. Actuall... (by abcdef123)
No clue how to start?
So i just transferred into a computer science and im like two weeks behind. I have no clue how to even start this project, please help! Problem Statement: You...
Sep 16, 2017 at 2:19pm
[5 replies] Last: jonnin, I stand corrected. (by Enoizat)
Question
Hi guys , i have a question . Example : i declared 2 int variables . It is possible to find which is maximum and which is minimum without using cicles ( if , fo...
Sep 16, 2017 at 12:29pm
[2 replies] Last: http://www.geeksforgeeks.org/compute-the-minimum-or-maximum-max-of-two... (by Thomas1965)
SDL Snake Clone has troubles rendering the snake
Hi everyone! I rencently discovered the SDL library, and when I tought I was ready for it, I started making a Snake Clone. For now, I just control the snake us...
Sep 16, 2017 at 10:22am
[2 replies] Last: That makes sense, thanks alot (by goldenchicken)
Create a file list (platform-independent way?)
Hi guys, although this questions has been asked many times, I haven't found a working solution for me yet. I want to create a function that returns a std::v...
Sep 16, 2017 at 8:35am
[3 replies] Last: @Duthomhas Thank you very much for your solution with the recursion. B... (by olfibits)
Is this a legit optimization?
In the out() function below, which sums elements, you can see I have a switch case to do the summation in a single line, and in the default case (for any more ...
Sep 16, 2017 at 7:49am
[3 replies] Last: JLBorges: That's extremely helpful! It looks like you got the assembl... (by G0rdano)
geting question marks for quotation marks
I'm reading from a file that has quotation marks and when it reads the quotation marks, i get question marks printed out. what do i need to do to fit it? st...
Sep 15, 2017 at 8:38pm
[4 replies] Last: ... (by Duthomhas)
How to use a language to program instances of class?
Hello! I begin to make a game creator for myself. I want to use c++ for the engine (work in progress), and made the gui in C# or Java (WIP too...). But what ...
Sep 15, 2017 at 8:15pm
[2 replies] Last: A class factory has nothing to do with code interpretation or run-time... (by helios)
Problem
Hi guys . How do i measure the length of an array ? Better to say : how do i pass every element from array? i found with begin() , end(), etc but doesnt work. ...
Sep 15, 2017 at 7:16pm
[5 replies] Last: what I have always pondered about this question is not how to do it b... (by jonnin)
Two phase name lookup (most of it) in the Microsoft compiler
https://blogs.msdn.microsoft.com/vcblog/2017/09/11/two-phase-name-lookup-support-comes-to-msvc/ 1. Update to the current version 2. Compile with -permissive-...
Sep 15, 2017 at 5:20pm
[2 replies] Last: Whoa, I had no idea MSVC used Yacc. That's pretty crazy for C++. I won... (by helios)
how to format/truncate
Hi, Want to format and truncate/round my number at the same time in the program: Here I want the + sign shown: float n = 3.8; printf("%+f", n); =+3.800000...
Sep 15, 2017 at 2:19pm
[3 replies] Last: Worked great, thanx (by technologist)
by biomod
Undefined symbol error
Hi, I've recently taken over a project and therefore I am not completely familiar with it - however, I've encountered an undefined symbol error on the line: D...
Sep 15, 2017 at 9:48am
[8 replies] Last: C++ Builder 6 Yes that is a bit dated indeed. If you're working on... (by Chervil)
Trouble while trying to find a specific word
hey. im trying to find a word in a txt file and if it is found count 11 lines after it, then save the word in a var and the destination in a var. cant eve...
Sep 14, 2017 at 11:38pm
[4 replies] Last: thank u guys, and yeah i can open files on c++ but i didnt know how to... (by lukardos)
precise definition of "precision"
What exactly is the precise definition of "precision" of a numeric field? As far as I know, it should be the "number of digits after the decimal point". ...
Sep 14, 2017 at 6:30pm
[7 replies] Last: > Here, a precision of 2 prints 3 decimal digits rather than 2, which ... (by JLBorges)
Can I change the way functions work?
When you pass a variable to a function in a function call, the function makes a copy of the variable so that any changes made to the value of the variable only ...
Sep 14, 2017 at 5:33pm
[3 replies] Last: For fuck's sake. (by helios)
How to connect objects in order to transport data between them?
Suppose I have a class Object which can send or receive some data: class Object { protected: int data; public: void SendData(); void Receiv...
Sep 14, 2017 at 5:01pm
[2 replies] Last: The way you've stated it, the problem you're trying to solve has a ver... (by helios)
by abc1
virtual functions
hi, I am very new to virtual functions of c++. what is virtual function?why it is used? please help me in learning this concept.
Sep 14, 2017 at 1:58pm
[13 replies] Last: > Why it is not method overiding? If we are talking about C++, we use... (by JLBorges)
"no matching function calling for getline" error (1,2)
I got this Build message: 1>------ Build started: Project: chapter17ex7, Configuration: Debug Win32 ------ 1>chapter17ex7.cpp 1>chapter17ex7.cpp(18,36): e...
Sep 14, 2017 at 1:30pm
[38 replies] Last: Yeah, thanks. Done. (by DragonOsman)
Comparing two char within the same array
Hey guys, I am trying to make a comparison within an array that when you enter a character that is already in the array, it gives you "element is a duplicate". ...
Sep 14, 2017 at 1:10pm
[7 replies] Last: thank you guys, helped me heaps !! (by haddaauk)
September 2017 Pages: 1... 45678... 11
  Archived months: [aug2017] [oct2017]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.