• Forum
  • General C++ Programming

General C++ Programming

by admin
Welcome to this board!
Welcome to the general programming forum in C++.com! In this forum, users can to talk about any topic related to programming in the C++ language that does not ...
[no replies]
How to take 2D FFT of 3D matrix?
I am using eigen tensor to define my 3D matrix and would like to perform a 2d fft on it. Originally, I was trying to follow with my other code where I take 1d ...
[9 replies] Last: Well, few cases to work, but I have questions if that's okay. The firs... (by JamieAl)
WPA2 Handshake extract hash value?
Hello there, i recently wrote some lines of C++ code to read in wordlists, to chunk them up into smaller ones and to crack a hash value by calculating and co...
[no replies]
On order of data members only
Does the order of data members only in class (so many) matter and is it quite influential in accesses efficiency ? if yes or no, how is each logical reasons ?...
[4 replies] Last: "alignment" When I did look at SSE/SSE2 intrinsics (long time ago, be... (by keskiverto)
How do we change an operator character in c++
Anyone very knowledgeable in C++ so able to change an operator character ? e.g. a != b become a >< b What the real wanted or asked is the constructor i...
[17 replies] Last: BTW, a**b**c should be a**(b**c) :) :) right associative. but which... (by seeplus)
Have gcc i.e. GNU c++ compiler ignore shebang
This error urges act on how to make GNU c++ ignore shebang: m.cpp:1:2: error: invalid preprocessing directive #! 1 | #!/usr/bin/vim Please do favour solv...
[2 replies] Last: @ abdul I am unsure why you have this obsession with doing weird thin... (by Duthomhas)
! and ~ in an enum data type
What is accurate detail difference on operator ! and ~ in an enum data type operation (as read one's code of it)? isn't just the same negation?
[3 replies] Last: > operator ! and ~ in an enum data type These arithmetic operators ar... (by JLBorges)
how to prevent duplicate when compare 2 string vector.
#include <iostream> #include <vector> #include <random> #include <algorithm> #include <iterator> #include <ctime> #include <set> using namespace s...
[4 replies] Last: @seeplus that's a very short and sweet piece of code. I didn't know I ... (by Worldtreeboy)
C++ today
Hi everyone, I've been out of the scope from C++ for years and I would like to get back on it. I usually worked with eclipse environment what was OK about wha...
[4 replies] Last: ... and there are a few decent libraries around on public git repos no... (by kbw)
Is md5 input plain limited to 32 chars ?
Hello all, in cannot understand why you can pass more than 32 characters into the md5 hash function. Ive seen the Implementation of mfontanini ( https://github...
[11 replies] Last: I use the MD5 from openssl. md5.hpp #pragma once #include <openssl/... (by kbw)
by new1
Random hex code generation saving
Hi, I'm trying to generate a hex random generators and catch it in 2d array. ex o/p random hex: 0x12 0xff 0x34 0x3e 0x00 0xef 0x01 0x43 0xb3 .. .....
[6 replies] Last: Is there any better way for generation of hex As jonnin mentions if ... (by George P)
by Cplusc
get a digit of an enum
hello forum I have a enum data type which is enum Type { D1Q3, D2Q9, D3Q19, D3Q27 }; The first number is the dimension of my problem and the second n...
[10 replies] Last: I really do not understand why the language is still missing simple en... (by helios)
ranges split
This code works as expected and produces the expected output: #include <string_view> #include <ranges> #include <iostream> #include <vector> #include <iomani...
[8 replies] Last: For info, we've decided to use: template<typename T = std::string_v... (by seeplus)
by t im
About multi level pointer
Here is a code about multi level pointer: double* (*a) ; cout << sizeof(a) << endl; // 4 cout << sizeof(*a) << endl; // 72 cout << sizeof(**a) << endl...
[2 replies] Last: Thanks a lot for your detailed reply. I got it. (by t im)
How can I create a concept that tests for specialization?
Hi, I want to create a concept that can only be applied to std::vector<T> for any T... Some predicate like is_specialization_of ... Thanks
[4 replies] Last: Maybe in C++26... (by seeplus)
by t im
Decompose Number with Prime Factor
Given a number n, Here are two operations can be taken: * n - 1 * n divide by its prime factor Question: In order to decompose n to 1, what is the minimal o...
[6 replies] Last: Oh, I misread that. (I’m bad at that, it seems.) (by Duthomhas)
Need g++ all compilation work files in some location
How do we put gcc/g++ all compilation work files in other certain directory ?
[1 reply] : The location and the names of auxiliary and dump outputs can be adjust... (by JLBorges)
Error in copying element of one array to another in C++
This is a very simple issue that for some reason I am not sure why I keep getting wrong. I am basically trying to copy array ``n`` to array ``dummy`` as the fol...
[6 replies] Last: You can do the copy with something like [ ] real_buffer from_plain_... (by mbozzi)
Loop by use of `:` specification and/or definition
What exactly is a c++ loop by use of : definition, how define its upper limit? is its equivalent to the common loop for (int i=0; i<5; ++i) { cout << i ; } ...
[3 replies] Last: As described in that cppreference page, the for ( int i : n ) { cou... (by keskiverto)
creation of simple tree like structure using stl vector c++, need help : )
i would like to create a tree like structure in c++. since the number of children per node is arbitrary i would like to use stl vector for tree creation. ...
[8 replies] Last: When we did this at Univ in the dim and distant past, we had the examp... (by seeplus)
Pages: 1234
  Archived months: [aug2022]