General C++ Programming - January 2019 (Page 7)

C++: how find a dot on a word\number?
 
i get these print: "0.45" ok... these number is found on vector. now i must test if i get the dot: cout << "\ntest: " << tokens .Description << "\n"; if( ...
[2 replies] Last: fixed.. i commented the warning list, that's why i wasn't getting the ... (by Cambalinho)
by frek
constexpr (1,2)
 
Hi, Please consider this simple code: constexpr double square(double x) { return x*x; } Now we use it this way: double var = 17; constexpr double m...
[36 replies] Last: constexpr itself is not part of the type of an object, and so type c... (by mbozzi)
Game Puzzle - My number (1,2)
 
I need help for school. I cin(enter) 6 number and I need a program that the first 5 number combined with basic mathematical operations(+, -, * and /) to get the...
[32 replies] Last: But don't paste that as your homework you will get caught. What if the... (by Grime)
by frek
Start learning C++ socket programming
 
Hello, I'm a C++ programmer and my experience is rather fine in this case. For some Qt app written on Windows, I need socket programming. This will be the fi...
[11 replies] Last: Thank all of you very much for your help. My plan is as follows. Pleas... (by frek)
Differences in warnings between compilers
 
I regularly use Visual Studio 2017 and Code::Blocks 17.12 (TDM-GCC) 5.1.0 to compile C++ code. #include <iostream> int main() { for (int i : { 0, 1 ...
[no replies]
Need help to compile a program
 
Hello, I am new in C++ and I tried to compile below program https://github.com/T800G/ChangeFileExtensionShellMenu I got below errors: https://i.imgur.co...
[1 reply] : Maybe you have the wrong project type. See: https://docs.microsoft.co... (by coder777)
Why does vector's capacity does not reduce when they are assigned fewer elements.
 
Hi, I tried running the following code (main()) and found that capacity/space reserved for vectors doesn't reduce even when it holds fewer element than befor...
[9 replies] Last: I could see that it all depends on what the requirement is. Maybe if w... (by kapil2905)
Can someone explain the logic of this codes please
 
QStringList Para_Meters; std::string Secret_Code; QString CaptureInterval; QString MaximumCaptureTime; std::string Para_Meter...
[3 replies] Last: That's a sizeable chunk of code. Can you be specific about which bit(... (by MikeyBoy)
need help understaning pointers to shared pointer
 
I came across this function that I'm having a hard time with the syntax std::vector<std::shared_ptr<GameObject>>* Worldmap is used on almost all of the p...
[1 reply] : It is actually not a pointer to a shared_ptr. It is a pointer to a ve... (by coder777)
The value of array outside the domain
 
Dear all, In the following program, I have initialize the value of compound array to 10 (where j=3 is not included), then I put the value of array beyond the...
[1 reply] : What you are doing is an error and is considered "undefined behavior",... (by dutch)
Asynchronous event handling in c++
 
How would I go about making an asynchronous event handler. I am working on making a terminal game and I need to asynchronously handle the keyboard input events....
[10 replies] Last: Sorry for being late, you will have to compile it from source (unless ... (by poteto)
Can we insert 0/null into the AVL tree?
 
I was wondering can we insert a null/0 into the AVL tree or not.
[2 replies] Last: Yes, I agreed. Thanks for your reply Peter87. (by akash16)
Priority Queue and Mergesort
 
Is there anybody who can tell me in which situation it will be smart to use Priority Queue instead of Mergesort and vise versa?
[3 replies] Last: In my experience, the only time that items really need to be sorted ... (by dhayden)
Code Blocks: when i use the dot, why i don't get the list?
 
i'm using Code Blocks 17.12... speaking on vector... when i do: FuncList . 1 list menu is showed with these:"_M_emplace_aux()".. why these instead the stru...
[6 replies] Last: that's true, but it's fixed... ok on header i must change it ;) thanks (by Cambalinho)
Class and while loop
 
#include <iostream> #include <string> #include <fstream> #include <iomanip> #include <ctime> using namespace std; class Hastane { private: long lo...
[3 replies] Last: My first suggestion is that you stop opening and closing files all ove... (by jlb)
Cocos2d-x physics project help!
 
Hello, I am making a physics-based game for Windows computers, I have the main menu set up as well as a level selection menu (with no level buttons). I have ...
[no replies]
The cocos2d-x drawnode
 
This question will not be in the knowledge boundaries of everyone. What is the drawnode capable of doing, what is it and how do you use it? (the 2D one)
[no replies]
Does "explicit" keyword disallow array decaying ?
 
Hi, I am trying to run the following code but getting error. error: conversion from ‘const char ’ to non-scalar type ‘kapil::string’ requested te...
[3 replies] Last: Thanks @dutch & @JLBorges for your inputs :) (by kapil2905)
atomic variables and ordering
 
If I have int x; atomic<bool> y; then in thread one if (!y) { x = 23; y = true; } and in thread two if (y) { cout << x; y = false...
[2 replies] Last: Since x and y have static storage duration, they would be zero ini... (by JLBorges)
by a00
confused scope problem
 
This is my code: #include <iostream> #include <sstream> #include <string> #include <stdlib.h> using namespace std; class string_number{ public: string_nu...
[2 replies] Last: omg i felt so shameful. i have the urge to just delete it. (by a00)
January 2019 Pages: 1... 567
  Archived months: [dec2018] [feb2019]

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