General C++ Programming - May 2019 (Page 2)

Streaming data. NTFS v ext4
 
I have data files that I use to stream data into vectors for analysis. When using Windows(NTFS), it takes like 10x as long to stream the file than Linux. I'm wo...
[16 replies] Last: Maybe so, but the elephant in the room is the god-awful slowness of pa... (by salem c)
Making a matrice with a headline.
 
Hey! I've been struggling to get this done, I can make a normal matrice work, but I can't figure out how to make it so the first line is a headline, that I wo...
[8 replies] Last: I've tried changing the row and column sizes from constants to variab... (by George P)
by frek
Use of import instead of #include
 
Hello all, Is it now possible to use import instead of #include in C++ programs? If yes, how to use import in this sample code? #include <iostream> ...
[14 replies] Last: In theory, better compile times. (by helios)
A project you might find useful
 
I recently open sourced a very large project of mine, called CIDLib, on GitHub. I just wanted to make it known to this community. I've posted a bit about it els...
[11 replies] Last: No worries. Good thing I gave your last reply a third read before I hi... (by helios)
Anyone can help me to change it to pseudocode??
 
#include <iostream> #include <cmath> using namespace std; int main() { double x; int n; cout << "x: "; cin >> x; cout << "n: "; cin >> n; ...
[10 replies] Last: line 12 in that code how to change to pseucode or even flowchart will... (by MikeStgt)
by Dee5
finding largest prime number in a file (1,2)
 
hello guys,Anyone having an idea of creating a programm that is able to find largest prime number in a file containing 100,000 numbers. Also,to print out the ...
[31 replies] Last: I know. But I don't have any good way to know whether a given piece o... (by jonnin)
Urgent Help me!!!!
 
#include <iostream> using namespace std; int main (int argc, char *argv ) { int x,n; cout<<"Please enter values for x : "; cin>>x; cout<<"Please enter values...
[13 replies] Last: #include <iostream> #include <cmath> using namespace std; int main()... (by lastchance)
How To Solve throw std::bad_alloc{};?
 
Hello Professionals, Good day. I would like to ask if there's any way I can get rid of throw std::bad_alloc{};? #else // ^^^ Managed ^^^ // vvv Native vvv...
[10 replies] Last: I also tried to print the max.size of my std vectors, and this is wha... (by coder777)
by jpao
Read/Write .MP4 Files WITHOUT Library
 
Hi everyone, I need to make a personal library that can read, manipulate, and write .MP4 files. And I need to do it without libraries. How do you read/wri...
[15 replies] Last: Thanks for taking the time to put forward all your suggestions guys! (by jpao)
Competitive Programming Problem
 
The problem and my attempted code solution is as follows: Farming is competitive business -- particularly milk production. Farmer John figures that if he doesn'...
[6 replies] Last: Thanks soo much! (by aceadams)
Problem!!! Help!!
 
Hi guys! I have a problem that i hope you give me an advice to solve it. I have writing this code and it doesn't run cuz its a problem. C2562 'Draw':'void' fu...
[4 replies] Last: Show a complete example that reproduces your issue, else you're just w... (by Ganado)
Trying to finish my unscrambling project
 
Hi, I am doing the project ideas that I found on the forum for people wanting to get better at C++ ( http://www.cplusplus.com/forum/beginner/3473/) and I am stu...
[8 replies] Last: :D Hahaha yeah I just learned it today *facepalm*. I went on to the n... (by Niccolo)
by kitfox
Does C++ have anything like Java's inner classes?
 
I sometimes come across a situation where I want to create a class manages a list of records. The records themselves will never be used outside of the class, b...
[5 replies] Last: for what its worth, in my experience, as soon as you block something f... (by jonnin)
by Manga
tons of errors
 
vs2019 gives me lots of errors. Here is my code... #include <iostream> #include <vector> using namespace std; class funV { std::vector<int> v; public: /...
[8 replies] Last: Thanks Ganado... adding std:: solved my problem. And yes I will add a... (by Manga)
How to pass pointer by reference in C?
 
I have the following code in C (not C++): int main(){ double *ptr=0; double x ={1,2,3}; double y ={4,5}; ptr=&x; for (int i=0; ...
[10 replies] Last: you are correct, C does not have references. The two languages are f... (by jonnin)
I created a class that acts just like a set but uses OpenMP to run in parallel to make everything faster, your thoughts? (1,2)
 
I created a class that does just about everything a set does in C++, such as insertion, deletion, and searching but I used OpenMP to make it run in parallel so ...
[24 replies] Last: 1. srandom() and random() are not standard C functions. They're UNIX f... (by helios)
Math Game c++ , division issue.
 
Hello Got a small problem here , I spent 2 days writing this with debugging sessions , alone, here is the thing its working and all but sometimes it just div...
[6 replies] Last: Hey guys thank you for your support , I did learn new stuff and yes I ... (by LonlyNerds)
How do call a function in a seperate class?
 
I made a function in, let's say class X like so. In the X.h I typed: void func(); In X.cpp void X::func(){} And I want to use func(); in class Y, in a me...
[2 replies] Last: How do I call a function from one class into another? You need to pas... (by coder777)
by frek
Enum class "put to" operator overloading
 
Hi all, Is the class Color defined below a scoped enum class? Is it due to the word class in its definition? int main() { enum class Color { red, blue, g...
[5 replies] Last: > What are the differences between these two, please? They are summar... (by JLBorges)
Trying to print elements of an array of derived classes
 
In main.cpp, when it gets to void printShapesInArray(...) , the print functiion of the corresponding shape in the array doesn't get called, I believe. main....
[5 replies] Last: > altMenu(shapesArr, arraySize); > Warning C6001 Using uninitialized m... (by ne555)
May 2019 Pages: 1234... 7
  Archived months: [apr2019] [jun2019]

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