General C++ Programming - July 2021 (Page 3)

How can i get a array in another class
 
Hello , I created a public array in class A . I want to get this array in class B . so this is my code . std::array<QString,25> Inputs; int compteu...
[10 replies] Last: You're welcome! (by MikeyBoy)
converting morse code to english
 
Hey guys, i am new to programming and trying to write a program that converts english to morse and vice versa. i wrote the english to morse part but i am strug...
[6 replies] Last: Don't worry about it, efficient comes with time and deeper study. The... (by jonnin)
how I can get the variable from a for loop for each iteration
 
Hello , I am really new in C++ development. I need to get the variable of each iteration in a for loop . How can i do this thank you
[8 replies] Last: #include <iostream> int main() { int var1{0}; int var2{0}; ... (by againtry)
create function to retrive data from CSV file
 
Hello , Currently i work on a Qt Application using C++. I am really new in c++ development. I uploaded a CSV file . I want to create a function to browse th...
[6 replies] Last: To extract just one element from a csv file, perhaps: #include <fst... (by seeplus)
E1696 E0020 errors using VS (1,2,3)
 
Hi All I am getting below errors while trying to compile the code in vs. How can I fix it? Should I use _WIN32 instead of WIN32? E1696 cannot open source file...
[48 replies] Last: There are too many things possibly you can do for anyone to keep answe... (by kbw)
by Cplusc
error LNK2019: unresolved external symbol "public
 
I am trying to build a class for mpi send and receive. I made this class without using template. now I am trying to use template. in order to get the MPI_dataty...
[9 replies] Last: yes it's returning the type if I defined something like const char* x=... (by Cplusc)
by Cplusc
Flatten class and send with mpi
 
let say I have a header file like below. I have problem in send buffer.why I can't write &iterator.next. what should I write instead anybody?anybody can help m...
[10 replies] Last: thanks for your help. yes, the function is this,https://www.mpich.org... (by Cplusc)
push_back() a vector into a 3D vector causes memory leak
 
I will try to explain the issue as best as I can. First I will present the code: for (int i=0; i<200000; i++){ //3 variables dealing with pathways v...
[19 replies] Last: For test code to try to identify the issue, consider: #include <vec... (by seeplus)
by RicoJ
What is this syntax for initializing 2D array?
 
This is technically C and I understand this is a common way to initialize a 2D array: const char* str_arr ={{"lol", "hehe"}, {"hehe", "hehehe"}}; However...
[6 replies] Last: Thanks @mbozzi, this is designated initialization: https://gcc.gnu.org... (by RicoJ)
by Cplusc
Sending vector of vector with mpi
 
I want to send the vector<vector<int>> vec from processor 1 to processor 2. Let say the vec {{1,2,4},{2,3,5},{3,4,6},{4,5,2},{3,4,6}}. I send the vec like this...
[6 replies] Last: [quote=resabzr]I mean if before flattening we use i,j to access data i... (by lastchance)
What is Projection as in the ranges library?
 
Projection is defined as a mapping of a set into a subset.In the ranges library the std::ranges::sort it is possible to define the ordering by a projection (whi...
[2 replies] Last: I think it comes from the relational world as in: Projections - The... (by JUANDENT)
Writing integers to binary files
 
Hello all, I am currently working on a program that reads in from a txt file and outputs data to a binary file. The input file consists of both strings and inte...
[10 replies] Last: It says 'int' in the type, one might reasonably expect it to behave i... (by seeplus)
std::function issue C2664
 
Hello Could I request a help in following problem? I have a base class called cParent. It's child is cChild //This is a sharedPtr. I have 1000's of th...
[2 replies] Last: Sure. I will The thing is, I have 5 classes.. and all of them have... (by nidhinWilliam)
by Cplusc
MPI SEND and RECEIVE
 
let say we have a vector of vector of vector of type integer. The out vector is referring to the number of processors. Let's say that this vector is something l...
[8 replies] Last: @helios No (by Cplusc)
by Cplusc
uninitialized local variable (1,2)
 
lets say I have a text file which contains a mesh properties. I define a class named Mesh which reads the file and gives me the information which I named it Glo...
[22 replies] Last: @resabzr, You don't need your own Vector class. A normal std::vector h... (by lastchance)
by zapshe
default constructor does not exist in the class
 
You have a constructor which takes two arguments, two integers. You have NO constructor that takes 0 arguments. Hence, trying to make a Matrix m1 fails, becau...
[2 replies] Last: Into the abyss. (by zapshe)
my template code seems unusable
 
I describe the template class as follows for a stack, Which uses a specific type to generalize the concept of stacks. Complete code: #include <iostream...
[14 replies] Last: Memory leak. Correct. Thanks. I was in too much of a hurry...... Mo... (by seeplus)
Need help on my assignment
 
Create the logic for the dice game Twig, in which a player can compete with the computer. The object of the game is to be the first to score 10 points. The user...
[4 replies] Last: is it possible to loop a random result and accummulate at the same ti... (by kbw)
by Cplusc
getline is not working
 
I have a class named Mesh like this #ifndef _MESH_H_ #define _MESH_H_ #include "includes.h" #include "typedefs.h" class Mesh { public: size_t Nnodes_; ...
[8 replies] Last: Thanks for your answer (by Cplusc)
Test Scores
 
Hello, I need help writing a program that reads in 10 test scores. The test scores should be integers and should be stored in an array and they should print ou...
[5 replies] Last: scores = [ int( s ) for s in input( 'Enter test scores: ' ).split() ]... (by lastchance)
July 2021 Pages: 12345
  Archived months: [jun2021] [aug2021]

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