General C++ Programming - December 2018 (Page 2)

Help with movement
 
Hello guys, I want to make a console movement charecter something like $ to move up down right left and I have no clue how to get started with the code of t...
[7 replies] Last: @whitenite thanks for the example man. @Grime I do have system("CLS")... (by OshriMakk)
Finding the letters within a word
 
As I'm sure you're aware, finding the length, first letter and last letter of a word is as simple as typing: string name; /*name.length() ...
[1 reply] : Your question isn't quite clear. If you want to find a substring with... (by Grime)
How to fix the displaying a board in a game
 
I am creating a board with 'X' and 'O' which prints 'X' when the number is even and prints 'O' when the number is odd. But when I display the board, I am gett...
[3 replies] Last: Look at line 34 carefully: if (p1 % 2 == 0) { p1 == 'X'; } else... (by JLBorges)
by emron
How do I find the intersection of rectangles?
 
Hello everybody, My have a homework and it is very hard for me. My question: How do I find the intersection of rectangles? My homework shortly; You're lookin...
[2 replies] Last: #include <iostream> #include <sstream> #include <vector> #include <ut... (by lastchance)
License key generation
 
Hello! I would like to know how to make license keys for my program? How to prevent the transfer of key to other users. Do you use licenses for your programs?
[15 replies] Last: You're right. I will use tips that are written above. I improve my app... (by Banananas)
Is it possible to perform multiple initializations with one constructor?
 
For example: class Rectangle { public: explicit Rectangle( int initialWidth = 0, int initialLength = 0, int initialArea = 0; int initialParameter = 0) : ...
[4 replies] Last: All bases and members of an object are initialized on construction o... (by keskiverto)
Why is string class not final ?
 
Hi, I have never come across a scenario where we derive from string class but still the string class is not a final class. I have following points to ask ...
[4 replies] Last: Well, STL classes have not been designed to be inherited. The major is... (by sp356069)
Where do I even begin with a Core Dump (Segmentation Fault)?
 
When I tried to compile my program, I got this error: "Segmentation fault (core dumped)" The problem is, I have no idea where to even start. With a segmen...
[9 replies] Last: gdb (unix command should be there with your compiler) will let you loo... (by jonnin)
how create a read function?
 
i'm creating the read(). my big objective on function: 1 - no arguments for wait the user press enter(cin.get()); 2 - accept several parameters for read to s...
[7 replies] Last: i found the problem: void read() { //wait if the eneter key is pr... (by Cambalinho)
linking xcode with Buddy library
 
ello i'm trying to linking buddy library with xcode c++ to use it .. i have dependency problem i do not know way ! i downloaded the library from git then in...
[1 reply] : > i have dependency problem ¿error message? ¿what are you missing? ... (by ne555)
GNU compiler: do i need include the header file on compiler commands?
 
i have created my own header file... using command line\console, i can compile using the GNU compile parameters. but do i need include my header file on param...
[9 replies] Last: "When people post simplified examples of their code the real problem i... (by Cambalinho)
std::swap and memory addresses
 
So I was reading C++ Primer (5th Edition) and came across this: The fact that elements are not moved means that, with the exception of string , iterators, ref...
[3 replies] Last: Ah, I missed the whole concept. It did mention in the book before, tha... (by closed account ywbpSL3A)
by Azra
Thread safe deque implementation
 
hi l am newbie to c++.l need to implement deque with two threads.one thread will keep on pushing data for every 1 sec using push_back() and other thread will p...
[2 replies] Last: Try this: https://github.com/Konstantin-2/misc/blob/master/tsqueue.h ... (by Konstantin2)
Free PVS-Studio for those who develops open source projects
 
PVS-Studio is a tool for detecting bugs and security weaknesses in the source code of programs, written in C, C++, and C#. It works in Windows, Linux, and macOS...
[no replies]
How to use make_unique with custom deleter lambda for arrays in c++14
 
Hi ppl, I am wondering it is possible to use make_shared with custom lambda deleter for arrays. I am trying to implement my string class using unique_ptr and n...
[6 replies] Last: Got it @JLBorges :) Thanks alot. (by kapil2905)
urgent response neaded
 
My teacher at senior high has asked for us to hand in a project Unfortunately, i have no idea, as to how to do it and if i don't i will fail the subject and re...
[1 reply] : Do not double-post. It is waste of everybody's time. Other thread: htt... (by keskiverto)
How to use unique_ptr and make_unique with const char*
 
Hi, I am trying to implement as string class using unique_ptr, but stuck with some issues. Here is my code : mystring.h namespace kapil { class string f...
[2 replies] Last: Thanks Repeater :) (by kapil2905)
by slei
std::variant undefined references
 
Hey, I've recently tried to use the c++17 std::variant feature. It seems to work fine with std::visit but on some compilers (specifically clang for android ndk)...
[2 replies] Last: @ne555 interesting, I'm using cmake with GLOB recurse. But maybe you'r... (by slei)
Reading Data from Multiple Files
 
I am trying to write a program which takes input from 1.yaml , 2.yaml ,3.yaml and so on for 300.yaml files one after the other i.e., my program processes the c...
[6 replies] Last: first is it to adding yaml.h with -lyaml or -lyaml-cpp to your linker ... (by aktony)
Is it not possible to overload functions based on rvalue reference.
 
Hi, I am just wondering why the following code gives ambiguous overload error? error: call of overloaded ‘fn(B)’ is ambiguous fn(B{}); class B { ...
[2 replies] Last: Thanks mbozzi. I was under wrong impression. :/ (by kapil2905)
December 2018 Pages: 1234... 10
  Archived months: [nov2018] [jan2019]

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