General C++ Programming - July 2018 (Page 7)

C vs C++ Question (1,2)
 
Hi, There are 65,700,000 results in google about C vs C++. But what I want to ask is this: A c++ Programmer said: All of the C benefits could also be achieved j...
[20 replies] Last: Thank you everybody, You guys have solved a decade-old question (by closed account DEhqDjzh)
Initialized Engine as a static variable, is it a good practice?
 
Initialized Engine as a static variable, is it a good practice? Something like this: class Engine { OpenGLSTUFF _openglstuff; public: void renderSo...
[3 replies] Last: > Initialized Engine as a static variable, is it a good practice? If ... (by JLBorges)
Need help with Topological Sorting
 
Hello, I am currently solving this problem on topological sorting: https://train.nzoi.org.nz/problems/475 However, my solution doesn't seem to be accepted. Ca...
[1 reply] : I haven't looked at any other code, but dfs() passes its adj vector by... (by helios)
deploying my programs to a different windows pc
 
i will be writing c++ programs using codeblocks and the gcc compiler. how do i identify the resource dlls, libraries, support files, etc, necessary to run a...
[1 reply] : check out http://www.dependencywalker.com/ Dependency Walker is a fre... (by stav)
Payroll class assignment
 
Here is the assignment that I'm working on, I have my program below, but I don't know where I got wrong, the program don't produce the correct output. Can someo...
[no replies]
by SHaD0S
Else if Statement syntax correction.
 
Hello everyone, i have a short assignment to do for my Introduction To Program Class. I've been working on it over and over trying to figure out what is wrong b...
[4 replies] Last: @kbw Your indentation is off. I've reposted your code with the indent... (by SHaD0S)
What is a program?
 
DIT subject Program Design DT282 program An algorithm that has been coded into something that can be run by a machine. program a series of software instructions...
[16 replies] Last: program a program is implemention of an algorithm to be run on a spec... (by Angel2014fly)
Help with array
 
The program to be written is a C ++ console application, and the length of the directory from the user want to be. In a set of Heap memory locations where ball...
[6 replies] Last: Ok for starters, heap memory is dynamically allocated memory. So now w... (by Manga)
Unresolved externals - Please help!
 
I have 2 projects p1: GestureDLL.cpp p2: Main.h Main.cpp I am trying to call functions from p1 so that I can export them in the DLL from p2. I have ...
[no replies]
Visual Studio 2017 Intellisense error
 
Severity Code Description Project File Line Suppression State Error (active) E2904 PCH warning: header stop not at file scope. An IntelliSense PCH file was n...
[8 replies] Last: I'm not exactly sure why that fixes it, but please note that you shoul... (by Ganado)
Arrays easy question
 
Could you write the code below using the heap? Enter the size of the array: 5 -> 0x10811f0 -> 0x1081200 -> 0x1081210 -> 0x1081220 -> 0x108...
[2 replies] Last: OMG! Thank you dude! (by guninho)
time complexity
 
i wanted to ask like if i am taking the input of a 2D array(n*n) and printing only the first row will my time complexity be O(n) or O(n^2)?
[8 replies] Last: ¿why are you all ignoring this part? The analysis always assumes t... (by dhayden)
Calling more complicated functions of a x in a Self-Defined Function
 
Hi all, I am tying to code an integral calculator as C++ practice over summer. I am able to find out how to include simple mathematical functions such as exp in...
[1 reply] : If you're using function pointers, you have to pass in a pointer. Mak... (by Ganado)
Coin flip
 
https://www.codechef.com/problems/FLIPCOIN My solution is giving tle. Any suggestions? #include<bits/stdc++.h> using namespace std; int heads(int *tails,in...
[2 replies] Last: Is there a need for a different data structure? If yes,how am I suppos... (by closed account 287LhbRD)
How to run functions in object array whose array number is below n
 
i am creating an game engine but now i have a problem. i want to create new object when user pressed button. but problem is when new object is being rendered th...
[15 replies] Last: @jonnin thank you (by closed account DEhqDjzh)
Is there any way to destory objects in if scope
 
I am creating a game and i have to destroy player when it collides with an enemy. But the player is a stack object. So must i create a player in heap in order t...
[9 replies] Last: If constructs like if( this_player.is_alive() ) { /* then do somethi... (by JLBorges)
Reading source file
 
Hey everyone. Is it possible to read a C++ source file using stream operators? I want to read a source file and output all the comments contained in that sou...
[4 replies] Last: Most, if not all, compilers require source files to be written in plai... (by closed account E0p9LyTq)
2d array arithmetic operation
 
Hi, I'm porting some old c++ code, and the original has one line which I cannot work out: if(abs(a - a ) < min_val) i++; where a is declared as static i...
[4 replies] Last: It looks like a bug to me. If the coder really wanted the size of the ... (by dhayden)
Massive Array
 
Hi there. I have a massive Array, which gets outputted to a .txt file. It looks a bit like this: there are are set of numbers ranging from 1-9 and then besi...
[3 replies] Last: As LastChance's elegant solution shows, you took a conceptual detour t... (by dhayden)
by clonxy
Need help with structures and vectors
 
// Your program implements some functionality extensively used in graphical user interfaces (GUI) and computer games. The program collects points/coordinates, g...
[5 replies] Last: Nevermind, failed the project. (by clonxy)
July 2018 Pages: 1... 56789
  Archived months: [jun2018] [aug2018]

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