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

SIMD: implement _mm256_max_epu64_
 
Hi. I want to ask a simple question about SIMD. I don't get the AVX512 in my CPU but want to have a _mm256_max_epu64. https://software.intel.com/sites/landin...
[5 replies] Last: I did this question also in stackoverflow https://stackoverflow.com/qu... (by CakeByTheOcean)
please help me solve this problem
 
i am trying to call some functions in my main function. #include <iostream> #include <math.h> using namespace std; int a = 1; double x; double y; int c...
[2 replies] Last: Two problems: Lines 73, 78, 83, 88: When you call a function you nee... (by AbstractionAnon)
Is const-ness deep/recursive ?
 
Most explanations of const are based on simple types, but what happens with objects containing references to other objects? Is const-ness shallow or infinitely ...
[7 replies] Last: Fair enough. It's pretty silly to do this, though: void foo(const in... (by helios)
About const & arguments (again)
 
I am working on a family of generalized container wrappers and sequence generators that provide the classic sequence facilities such as integer range, mapping o...
[4 replies] Last: Thanks for your response. I think I found the explanation here: https... (by CABrouwers)
error expected initializer before void line 7
 
#include <iostream> #include <cmath> using namespace std; // *********************************************************************** void showmenu(); void ...
[3 replies] Last: There are a number of issues in your code. 1. missing semicolons, yes... (by CABrouwers)
Why is SIMD slower than trivial loop.
 
Hi everyone. It is very wired that run SIMD code runs slower than Scalar code. What I want to is compare differ as uint16_t with a uint16_t array. std::vector<...
[9 replies] Last: Thanks for all discussion. I use cmake ninja and found following thing... (by CakeByTheOcean)
File not reading in and stuck in a While loop
 
Can anyone help me, I've been trying to open my txt file but it doesn't read in. The fail statement leaves me in an infinite loop telling me to enter a file nam...
[9 replies] Last: For whatever reason, you can't open lab2.txt so the open() at line 10 ... (by dhayden)
Problems with Comparing by Name & Comparing by Score
 
Objective: read a file containing a list of students' names followed by their test scores. Define a structure to store name and score. Instead of just a vect...
[2 replies] Last: Thank you very much! (by thesilentc)
Unknown Error In Bomber Game
 
I am having this unknown error in my code for a bomber game that I am making for a project. The code works and I've assigned a function for randomizing two diam...
[13 replies] Last: The function expects an integer variable ... and, as a reference, must... (by lastchance)
Need help with this programming problem
 
Hello, I am currently working on this programming problem: https://train.nzoi.org.nz/problems/794 My code seems to be working on test cases where n < 10,000 ex...
[6 replies] Last: i agree with dhayden in most part. but that's not a mistake, what you ... (by anup30)
by bob404
impossible error in "getsockopt"
 
Hi all! I'm starting to teach myself C++ to make a simple software because can't find programmers (at least here in Italy). Since I'm a kinesthetic person, to l...
[13 replies] Last: I think you're going about this the hard way. When you call socket()... (by AbstractionAnon)
Find prime factors of a number using 2 user defined functions
 
Hi programmers, I am relatively new in C++ and I have been doing a self-study using the "C++ Without Fear" E-book by Brian Overland and some other online resou...
[3 replies] Last: I suggest that you change your main() program (temporarily) to call ge... (by dhayden)
how can i use class to programming c++
 
i have a question about the class in c++, my code its regular and i dont know if the code its correct, so i need some help. here I leave the code and if y...
[2 replies] Last: I see one potential problem. Class Not contains a raw pointer (_ptaE).... (by dhayden)
by H00G0
Suggestion for password hashing function
 
Hey guys! I'm working on a project which currently stored a user's credentials (username and password) on a file. For security reasons I'd like to hash th...
[11 replies] Last: yes, what I gave you was encryption. You can use a portion of it to m... (by jonnin)
Overrated attributes?
 
When you so called pros/cons of c++, people tend to mention AI and powerful as pros. Why so? Doesn't power depend on the capability of a computer and the storag...
[11 replies] Last: absolutely. (by jonnin)
by Ojies
Program ends at second while in function z1
 
I am very confused!
[3 replies] Last: Line 38: you confuse = (assignment) with == (comparison for equality) ... (by lastchance)
About Class
 
1. Define a class named Student with data members: name, f number and mark.
[1 reply] : Please note that this is not a homework site. We won't do your homewor... (by keskiverto)
by Allaye
Error 'Blending::Blend': non-standard syntax; use '&' to create a pointer to member
 
Am having a function called "createtrackbar" that takes a function with a pointer argument as argument, am calling the the function am passing to createtrackb...
[2 replies] Last: in your main createTrackbar("Blend", "Blendimage", &defaultvalue, max... (by H00G0)
foo == (* foo)
 
This is a question of theory. Functions are pointers and, as the following code shows, the dereferenced value of a function pointer is itself. #include <i...
[2 replies] Last: Very, clear! Thank you very much. (by CABrouwers)
mixing &fun and fun in same function call
 
My understanding is that function arguments are always passed by reference whether prefixed with & or not. However, it seems that GCC gets confused when the two...
[4 replies] Last: @dutch Thanks for your reply, I do see that the problem is that the s... (by CABrouwers)
January 2019 Pages: 1234... 7
  Archived months: [dec2018] [feb2019]

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