Beginners - December 2022

Inheriting a Protected Field from a Base Class
 
I'm trying to implement my java assignment (it's working in java) to C++ but when I tried to inherit from the Animal class, Crocodile class' constructor says "c...
[5 replies] Last: Thanks for helping, I thought that C++ is inheriting fields like java.... (by bydrachen)
nothing is happening in the terminal
 
every time i enter an int in the terminal nothing is happening , then after i spam a few int it will show result but its wrong #include <iostream> usi...
[4 replies] Last: Why have "Calculate again" at the end of every case? Why not have afte... (by seeplus)
i need to keep entering in the terminal
 
when i put an int in terminal nothings happening, then after a few enter it will show result but the res is wrong #include <iostream> using namespace std;...
[2 replies] Last: Please don't double post: https://cplusplus.com/forum/beginner/285181/ (by kbw)
C++ by Deitel
 
HI All, I am writing code from the Book C++20. The code I write into VS Community 2022 works fine except that I have to change the language version. I have to ...
[4 replies] Last: So's I guess SWAG wasn't too intuitive either, eh? (by deleted account xyzzy)
debug strange behavior
 
Hi. Why my debugger doesn't go sequentially in the code? Sometimes it goes back (i am not talking about loops). and than continue. for example: iResult = s...
[3 replies] Last: Many compiler optimizations affect debugging. Consider using -Og -... (by Peter87)
Code meaning- structs and typecast
 
Hi. I have this code: struct SITAL_DEVICE_INTERNAL { SITAL_DEVICE_HANDLE hDevice; char UniqueDeviceName ; char DeviceID ; int Bars; SITAL_DEV...
[3 replies] Last: Thanks. i can give private access if someone would like. but i can't m... (by Jonathan100)
Error compiling .c program files using Visual C++ 2022
 
Need help compiling Encryption C program files downloaded from Github please: https://github.com/tbuktu/libntru Downloaded zip file has src folder with about 3...
[17 replies] Last: Thank you seeplus, for the excellent malloc idea. I will work on this... (by AlexCantor)
2d vector default value in class header
 
Greetings, I would like to give a class member default values within the header file of the class, so that I don't have to write a .cpp file. // .h fil...
[16 replies] Last: @seeplus Yeah, I realized my mistake and removed my post before you ... (by Peter87)
Send row of 2D vector with MPI
 
Greetings, I try to send the "row" of a vector of vectors with an mpi reduction operation, but I get a runtime error: A minimal example: #include <vector>...
[2 replies] Last: Thank you @lastchance. I forgot I had to use the first index of the i... (by PhysicsIsFun)
Expression must be a modifiable lvalue
 
i got a problem at line 15, thank you for your kind heart. #include <iostream> using namespace std; int main (){ cout << "Simple Calculator: \...
[3 replies] Last: Thank you everyone that solved it (by gabzz29)
How do I count the indexes of a dynamic class array
 
So, our professor tasked us with designing a code that will, basically, have a class "Course". This class will include a pointer char array CourseName, along wi...
[4 replies] Last: OK. But bare in mind that this isn't how you'd normally code it. A pos... (by seeplus)
#define in c++
 
How can I shorten macro as code bellow? i.e : DO_(n)(x) = DO_(n-1)(x),DO_(1)(x) Thank you #include <iostream> #define DO_1(x) &x #define DO_2(x) DO_1(x)...
[2 replies] Last: Perhaps you just need a recursive template. https://stackoverflow.com... (by salem c)
Merry Christmas to all C++ Developers
 
Wishing you the C++ developers Very, Very Merry Christmas. Many of you are great and extraordinarily talented C++ programming experts and have been helping m...
[2 replies] Last: Merry Christmas! (by Ganado)
Memory Overflow
 
Hi guys. In eclipse based Vitis, i got this error: c:/xilinx/vitis/2020.2/gnu/microblaze/nt/x86_64-oesdk-mingw32/usr/bin/microblaze-xilinx-elf/../../libexec...
[6 replies] Last: mb-g++ -Wl,--print-memory-usage Pass an option to the linker http... (by JLBorges)
by jNc
Program crushes after reaches x memory usage
 
How to release all memory related to current programm? Tried to re execute with atexit, but still having the same memory usage till manually close program
[4 replies] Last: If you use new, then use delete. if you use new , then use delete ... (by seeplus)
Unexpected compiling/linking errors
 
Hi guys! i am trying to compile some source codes in eclipse based Vitis. Unfortunately i am getting some errors - In previous projects with the same sourc...
[7 replies] Last: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines has multi... (by keskiverto)
by jNc
How to output struct CHAR_INFO contains
 
How to output struct CHAR_INFO contains?
[8 replies] Last: > I'm struggling to save to string output from terminal The tee (betw... (by JLBorges)
by jNc
Improve building time
 
Have a lot of functions, which placed before main If I move it inside main, will it affect building time?
[6 replies] Last: Furthermore, separate compilation units can be compiled simultaneously... (by keskiverto)
by jNc
Get previous cout text to string
 
Need to get previous cout text to string. Need to keep cout for debug Tried sstring buffer, but it can replace cout
[10 replies] Last: C++98, credits to JLBorges #include <iostream> #include <sstream> na... (by mbozzi)
by jNc
How can I skip getch press enter key to continue with function or command
 
Need to skip getch press enter key with function or terminal command
[2 replies] Last: getch is silent, the press enter to continue is usually an indication ... (by jonnin)
December 2022 Pages: 12
  Archived months: [nov2022] [jan2023]

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