General C++ Programming - June 2020 (Page 2)

by GonlyG
maze pathfinder looping forever
 
I borrowed a recursive maze path finder algorithm with the same logic as a working program, but can't figure out why it exceeds run time (the logic claims it's ...
[8 replies] Last: Because there, someone feels like he's helping ??? lol Where some peop... (by oneidacharisse)
Can someone recognise this error message and mention the potential reason plz...
 
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: /cygdrive/c/Users/FACULTY/AppData/Local/Temp/ccjfOIT1.o:figure03_13.cpp:(.text+0x48): u...
[11 replies] Last: > "C:\cygwin64\bin\g++.exe" -Wall -Wextra -Wpedantic -std=c++11 -o "He... (by salem c)
by volang
Separate code into multiple files
 
Good day. I have a question about separating code and using header files. My goal is... 1. Having a layout where most include files are specified only in ...
[17 replies] Last: What @jlb said. Also, namespaces inherently span multiple files. The... (by doug4)
Copy Elision for temporaries not working
 
According to C++ 17, the following code should compile: class MyClass { public: MyClass(const MyClass&) = delete; MyClass(MyClass&&) = delete; ...
[3 replies] Last: You should also be getting some warnings about your main() function. ... (by jlb)
by mary00
how to format data (1,2)
 
Hi guys, I'm not very expert but I should create a program in C that reads the data contained in an external text file about eeg signals and reprint them but i...
[30 replies] Last: can someone help me please??? I don't know how to solve with foef prob... (by mary00)
cpp.chat: It Doesn’t Get Bored and It Doesn’t Get Tired
 
This week we chat with a Yuri Minaev, of PVS Studio, about static analysis - and why you shouldn't be skipping on this essential part of software development. ...
[no replies]
by volang
Fastest way to communicate with another local process?
 
I have mysql running on my computer. How do I send querys from another application/process on same computer? Dont want connector/c++. I tried creating a sock...
[4 replies] Last: kbw Thanks for finding the link. That solved the problem (by volang)
copy a memset grid
 
Hello, how do I fill in a test grid and copy it into the final grid? To test a maximum of grid and keep the one with the most words placed. With a code like thi...
[14 replies] Last: yes, that is a ranged based for loop. (by jonnin)
by L67GS
C++ newbie
 
Hi, I'm very new to C++. I've written a pretty neat chatbot and have her doing some system commands. She'll be running on a battery powered SBC so I'm having he...
[8 replies] Last: Be aware that I'm talking about the exec system call, not the exec com... (by dhayden)
Testing if vectors are pointing in same direction
 
hey guys, so you guessed it I'm still studying vectors and game physics, My goal now is to test if both vectors are pointing in the same direction, why? becaus...
[5 replies] Last: The above answers are correct in the general case, where a vector is r... (by helios)
by volang
How does the filesystem search for files
 
How does the filesystem work? E.g. If I want to open "bob.txt" in a directory with 2 million other files, how is this string used to find the right file i...
[3 replies] Last: Great links. Thanks alot :) (by volang)
Accept, read and store txt file into strin array. then count
 
So I posted earlier and realized later I was wayyyy off. Now, I think I'm pretty close to doing what I was trying to do originally. I'm trying to open txt file,...
[7 replies] Last: I'm trying to open txt file, read the words into a string array, then... (by kbw)
Singly linked list from Binary File
 
I have created code that can generates random numbers between 0 and 99, then converts them to Binary. I now have to create a singly-linked list with the nodes i...
[2 replies] Last: Must you create the list yourself? Can you use std::list instead?... (by dhayden)
Get a rounded value of a non-integer in compile time ?
 
How to compute the rounded value of a non-integer i.e. float/double value in compile time ? In the best way as usually, as a function form e.g. constexpr fn(do...
[1 reply] : As usual, implementing correct algorithms for floating point numbers r... (by mbozzi)
Counting words in a string array c++
 
I am trying to write a code that takes words from a text file, reads them, stores them into a string array, and counts the words of the string array. I have bee...
[5 replies] Last: After I posted this, I realized what I was trying to do and what I was... (by schultzgirl)
What is base class inheritance use for?
 
So let's say I have these files: // dog.h file class Dog { public: void function(); } // cat.h file class Cat { public: void function(); } I was thin...
[9 replies] Last: [code firstline=13]public: // I want to overwrite the Animal::funct... (by MikeyBoy)
SDL subtracting vectors (1,2)
 
Hi guys, so as you can tell by my recent posts I'm messing around with SDL following a couple of tutorials on collisions and vectors/movement, so to subtr...
[21 replies] Last: one thing that still does kind of confuse me though is, why does magn... (by helios)
by GonlyG
rotating points getting wrong output
 
I'm given various names of stars on 2d plane and X, Y coordinates along with N deg of Counter clockwise rotation. I have to output them in smallest y, then x or...
[5 replies] Last: ah, thanks. I thought I had to calculate deg then add rot to it. Didn'... (by GonlyG)
Apology for not C++ topic but its nearby
 
Apology for not C++ topic but instead its nearby 'meta' process Why g++ option -MM -MF afile is not the same as -MM > afile ? The first is defected i.e. incorr...
[2 replies] Last: Not such, but as it's inside makefile , strongly suspected only if it ... (by marhuum)
When should I use a move contructor?
 
So I now a copy constructor can help us find rvalues in code. So should I use it here? class Example { Example(std::string&& example); } // does the copy ...
[4 replies] Last: Is the copy constructor used for taking a rvalue? No. Example st... (by mbozzi)
June 2020 Pages: 1234... 6
  Archived months: [may2020] [jul2020]

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