Beginners - January 2022 (Page 5)

virtual function syntax
 
Can not compile. Please help to amend Part 1/2 #define EMPLOYEE_H #include <string> // C++ standard string class class Employee { public: Employee( const ...
[8 replies] Last: Still don't understand meaning ifndef If Not Defined. https://stacko... (by deleted account xyzzy)
Do codeblocks c++ coding work with visual studios
 
I am curious that does codeblocks c++ coding works with visual studios or vise versa as both of them used c++ which is the same language.
[3 replies] Last: @jonnin @JLBorges Thanks (by s021623)
State machine events and object composition
 
Hi all, I have a project in which I designed a state machine class by composition of a whole bunch of features that are in the project class MasterFSM {...
[6 replies] Last: > First, you talk about an FSM, but you're describing an event process... (by JLBorges)
Getting the same number even after using srand function.
 
Hi. So I was trying to create a very simple code where it would randomly generate 10 different values. But despite using the srand function I'm still getting th...
[4 replies] Last: The reason you must put rand() % 10 + 1 inside the for loop is because... (by dhayden)
Undefined symbols for architecture arm64: - confused with putting it all together
 
Getting a error: Undefined symbols for architecture arm64: "grade(Student_info const&)" ld: symbol(s) not found for architecture arm64 clang: error: link...
[11 replies] Last: I have learnt. thank you, JLBorges and seeplus (by memepapa)
Linking libraries with g++: I'm truly lost.
 
Hello. I'm new to C++, trying to implement the Dear ImGui library. I've been banging my head against this for about two days, so I think that the best way to go...
[10 replies] Last: d3d11.h is mentioned in angle-brackets, implying it's part of the sta... (by mbozzi)
undeclared identifier vs no matching function for call to...
 
I'm trying to compile the following code which is from a very old book (2001) Accelerated C++ Practical Programming by Example by Andrew Koenig, Barbara E. M...
[17 replies] Last: This "Modern C++" eBook bundle certainly looks worthy as well: https:... (by deleted account xyzzy)
Merging two arrays with a defined range
 
Given two vectors - first vector nums1 = {1,2,3,0,0,0}; - second vector nums 2 = {4,5,6}; say if i want to merge only part of nums1 with all of num2, i.e. ...
[8 replies] Last: If it's done by appending, then possibly which then sorts the final ve... (by seeplus)
Problem with my code
 
Hi. I am very new to C++(just started today) and oopied this example from a very outdated book(C++ primer 2nd edition) and would like to know why it is not work...
[5 replies] Last: #include <iostream> void read2(int&, int&); void writeMax(int); int... (by seeplus)
String.at() - 'a'
 
Seeking help to see if I'm deducing correctly. for the code example below, s - 'a' means to subtract 97 so that the char 'a' starts at s and 'b' is at 1,...
[2 replies] Last: thanks JLBorges, enlightening as always. this stack-crooked.com onl... (by memepapa)
modifying private members across classes and setter/getter friendzy
 
Hi all, I have a project in which I have the following class tree with the main state machine class englobing everything. Shown is basically my classes to opera...
[3 replies] Last: > or you would use a pointer in the screen object > that can directly... (by JLBorges)
When is copy constructor called?
 
The question is pretty much in the title, I need help with understanding where exactly the copy constructor is called, as the output of this code doesn't match ...
[6 replies] Last: Why the first copy on line 21? The variable x1 is not accessible to ... (by coder777)
Using for loop to find powers
 
Hi all. I am trying to implement a code in a textbook but it is giving me an error unsigned int pow(int val,int exp) { for (unsigned int res=1;exp>0;...
[4 replies] Last: > The error message I'm getting is error: ‘res’ was not declared i... (by JLBorges)
by Ganado
complex signal
 
Something like // Example program #include <iostream> #include <complex> const double Pi = 3.14159265358979323846; std::complex<double> f(double t) { usi...
[6 replies] Last: True. As far as "doing the work"; if they ask a concise question about... (by Ganado)
Effective way to learn faster
 
Pardon the generic question, but i'm seeking the most effective way to learn given my current situation. I'm on the 6th day of my 21-day quarantine (solo) w...
[10 replies] Last: Idk if this has been said but practicing on hackerrank.com will shoot ... (by markyrocks)
Help with learning data structures
 
Dear all, currently, the only book i have for learning data structure is < C++ Data Structures and Algorithms > by Wisnu Anggoro (published by Packt> ) ...
[10 replies] Last: Another possible book is Fundamentals Of Data Structures in C++ https:... (by seeplus)
Convert char to int
 
Hi, i'm trying to make an exercise for University that receive 2 strings from a file, convert them into separate integers to insert them on stacks(this is said ...
[3 replies] Last: One use-case might be parsing g-code. The commands and their values ar... (by newbieg)
Why do these two pointers point to the same location after fread
 
Hello, I recently wrote something like this and was surprised by its behaviour. My attempt at distilling the surprising bit to a minimal repro follows: ...
[4 replies] Last: Thank you for the help. I'll try to keep the char vs char* in mind a... (by nottheone)
ostream operator
 
Is it possible to use ostream operator with two const Array Inside? Stable: friend std::ostream &operator<<( std::ostream &, const Array & ); Need: friend std::...
[8 replies] Last: [quote=impetus]struct syntax is unfamiliar yet for me. There are onli... (by deleted account xyzzy)
Guess word
 
Hello! It is necessary to create a game, I will show the conditions below. Currently, if the name is guessed, then the next word is no longer displayed - .... ...
[15 replies] Last: From OP first post: My code - So if this is the OP's code - how co... (by seeplus)
January 2022 Pages: 1... 3456
  Archived months: [dec2021] [feb2022]

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