General C++ Programming - June 2018 (Page 6)

Force Null Pointer Derefs to Crash?
 
Hello there! So if you dereference a null pointer accessing a function of class for example like: SomeClass *p = nullptr; p->DoSomething(); This can work per...
[3 replies] Last: Wrapping it in my own pointer class wouldn't be feasible with an exist... (by Spirrwell)
Skipping whitespaces when reading a numeric text file
 
I am trying to read (and output) a numeric text file filled with thousands of numbers (around 8000), but it is not working it keeps outputting random numbers, e...
[3 replies] Last: There's no need to skip whitespaces since the stream will do it for yo... (by Thomas1965)
How To Create Multiple Range-Based For Loops?
 
I am back again... :D I am trying to figure out if it's possible to implement multiple range-based for loops? So far, I see the patterns like: for (P...
[2 replies] Last: Thank you very much Mr. Repeater for your response. I overlooked this ... (by kindgnice)
LNK2019 unresolved external symbol __imp___CrtDbgReportW after adding a vector
 
Full error code:Error LNK2019 unresolved external symbol __imp___CrtDbgReportW referenced in function "void * __cdecl std::_Allocate(unsigned int,unsigned int,...
[2 replies] Last: smallest reproducible example. (by poteto)
Comparing and merging numbers
 
Hello everyone, Let's say I have a file with this content: 6 8 9 12 15 20 22 30 I am comparing the first number with the others then the 2nd n...
[3 replies] Last: Hmm I forgot to ask but by any chance, do you know how to also print t... (by inourss)
Reading and sorting words by 3rd letter in C++
 
Hi guys, I have a problem to solve and wanted some advice on the choices that I can make here. The problem: - Read 1 Mil words; - Sort them by third letter; -...
[13 replies] Last: @jonnin, The bucket sort is a great idea. I think it's the way to go. (by tpb)
by Aldo33
Need a solution with this Dijkstra Algorithm
 
Hello guys i really need help to complile my program due today midnight. It want Write a program, which computes the shortest paths in a graph. Given the graph ...
[3 replies] Last: I changed my code into something like this but it doesnt read from tex... (by Aldo33)
by zytsly
Help with pizza order program please!
 
I'm writing a program that can output the price of pizza, I had already written the beginning, but I don't know how to continue it...please give me a small hint...
[2 replies] Last: Thank you!!!! (by zytsly)
Question about struct sizes
 
Hi all, Basically been writing some code and I came across a funky error when reading a a file and was off by one with my struct definition. This was the orig...
[1 reply] : It's padding to make sure the types are align correctly. A primitive t... (by Peter87)
C++ indentation and some request for help with C++ error
 
Hi, I'm trying to "resurrect" old Turbo Vision library to use it on Linux/Solaris/*BSD. I know that it is quite well-maintained version of TVision on https://g...
[8 replies] Last: Are you mostly using it for C? Have you had any problems with C++ for... (by dhayden)
Multiple inheritance and virtual functions with differente signature bu same name
 
Dear experts, I have the following code which does not compile: #include <iostream> using namespace std; class A { public: virtual int foo(int i) =...
[7 replies] Last: my problem is that preD::foo needs to access something initialized in... (by dhayden)
problem with pointers
 
I want to implement the mutual-avoidance iteration with c++. The method consists to generate random points in the plane in order to obtain a point cloud. Then m...
[6 replies] Last: The code from the relativisticobserver page has the same error that yo... (by doug4)
by Lex33
Can Signal
 
I have also another problem with a task,perhaps somebody can tell me how I should paint it in 1)? 1. Sketch a CAN message at a speed in a voltage-time diagram ...
[5 replies] Last: I have also painted the Can Signal for 0xB5 Is it right ? https://www... (by Lex33)
problems with strings
 
I have to take a name that is in the format of Last, First Middle and give output that takes the string and puts it in the following format: First Name Middle ...
[4 replies] Last: Good that you got it working. I think there's an easier way. void i... (by Thomas1965)
How Will I Compute The Normals at Vertices using 3D Object? (1,2)
 
Hello Professionals, Good day. I would like to ask about the 3D aspect of my previous post recently. http://www.cplusplus.com/forum/general/233119/ Recently, ...
[22 replies] Last: Thank you very much to those who shared their insights and especially ... (by kindgnice)
by kokudo
C++ Arduino Coding
 
Hey guys. I'm very new to C++ coding and am stuck on a problem with my arduino code. I'm wondering how to write a code that involves 3 LEDs on my breadboard. I...
[1 reply] : it looks like you need more checks. something like if(high) pattern ... (by jonnin)
by Pickle
How to replace a part of .txt file with fstream
 
Hello, I tried to modify the content of .txt file using code below: (part of function) std::string sName,sInput; std::vector <std::vector <int>> vnOutput (...
[1 reply] : You cannot simply insert into the middle of a text file; you could pos... (by Repeater)
by Dani90
Need help!!!!
 
Hello ..how to calculate complexity for this algorithm f=1; x=3; for (int i = 1; i <= n; i*=2) for (int j = 1; j <= i * i; j++) if (i % j == 0) ...
[3 replies] Last: @tpb disgusting (by Dani90)
by Lex33
Task C++ Difficult help please
 
Hello I have a little Problem with this task . Some I have already implemented in the code: I will post the task with 2 post because the task ist too long ...
[15 replies] Last: Some Ideas Guys ? (by Lex33)
Adding Windows.h library in eclipse
 
Hi, I use compiler, which is minGW. Then, I installed opencv library through cmake and compiler with minGW. Now, I need to add windows.h library. But I dont ha...
[1 reply] : windows.h should come with your compiler you don't need to do anything... (by Yanson)
June 2018 Pages: 1... 456789
  Archived months: [may2018] [jul2018]

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