Beginners

by admin
Welcome -- read before posting!
 
Welcome to the beginner's forum in C++.com! In this forum, users can to talk about any topic related to C++ for non-expert audiences. Feel free to participate...
[2 replies] Last: How To Answer Questions in a Helpful Way Be gentle. Problem-relat... (by admin)
Console Closing Down (1,2,3,4,5,6,7)
 
Hi, i am new to C++ and have just written my "Hello World" program. It worked all right but the console/cmd closes down instantly. If you tell me why it is clos...
[120 replies] Last: It displayed "Hello world" after you pressed Enter. int c is a ... (by Duthomhas)
Lambda Expression: Specifying "this" in the capture clause
 
I'm reading an article on how to use lambda expressions and have some questions: 1. What is meant by "Only variables that are mentioned in the lambda body a...
[6 replies] Last: @Peter87, I am cognizant of the how and why of the differences in lamb... (by George PlusPlus)
Specifying a file address?
 
Hi, I am getting an error when trying to specify a file path for my program. It says "failed to open file for writing". I searched around google but couldn't f...
[8 replies] Last: seeplus already mentioned about the <format> library in C++20, a maj... (by George PlusPlus)
by zzzhhh
Why const literal class is not a constexpr even if initialized from a constexpr?
 
class test{ public: constexpr test(){} constexpr int operator+(const test& rhs) const { return 1+rhs.x ; } int x = 10 ; }; cons...
[4 replies] Last: Good point. I suppose you could remove x. I'm not sure what the point ... (by DizzyDon)
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is... (1,2)
 
Hi, I am getting an error when I run my program. the error is... Unhandled Exception: System.AccessViolationException: Attempted to read or write prote...
[26 replies] Last: you can choose to hunt down some of the offending memory hogs and mov... (by seeplus)
Bit set function not working correctly?
 
Good day, I don't know how to ask this as I don't totally understand things but I'm having an issue. My program reads tiles and tile sets from a game. The...
[12 replies] Last: [quote=Cyclone]My code is messy and had left over variables from testi... (by TheIdeasMan)
Git problem
 
Hi. I am trying to get out a confused git situation. I can't really remember how I got there, but I want to get out and manage to add, commit and push like bef...
[7 replies] Last: Thanks for the replays I kind of solved the issue (by Jonathan100)
by Mif
C programming. Using uninitialized memory warning.
 
I keep getting this warning even I initialize the memory, then I double-check the code paths to ensure no element in allNodes or closedSet is accessed before al...
[17 replies] Last: I found a lot of info and a few C implementations for the A* Search al... (by George PlusPlus)
by cgm2k7
Reading files with fread() in chunks.
 
Good morning everyone! I would like to ask for a little help here on the forum. It's like this. I have a binary file of (9175867 bytes), I need to read only (...
[18 replies] Last: Just wait for when you have EVERY post reported, including ones that p... (by George PlusPlus)
by demhat
function declaration with MACROs
 
hi guys as I know function declarations are like this: void ClearBackground(Color color); however sometimes I can face some kind of function decl...
[7 replies] Last: And, for one question within the OP: Yes, there can be more than just ... (by keskiverto)
MPI runtime weird example
 
Hi guys, I have a weird mpi example where I don't understand the used runtimes. #include <iostream> #include <mpi.h> #include <chrono> #include <cmath> void...
[1 reply] : its hard to know what is really going on with caches, other processes,... (by jonnin)
by zzzhhh
Why do I have to surround parentheses in this fold expression?
 
template<typename... Args> void printVariadic(Args... args) { (... , (std::cout << args << ' ')); } printVariadic(1, 2, 3, 4); This code can compile and p...
[1 reply] : Because the standard defines a unary left fold expression as: ( ...... (by Peter87)
need some help
 
That seems pretty close to being right, why don't you post the whole program? In case anyone stumbles on this nonsense, the original post / author got sh-canne...
[11 replies] Last: George, I would avoid directly hyperlinking the profile, if you don't ... (by Ganado)
by colt
Simple tga writer not working correctly.
 
Hi. I did write code to write a simple tga file format file. Unfortunately, it does not seem to work as expected. The resulting image is always black, not ma...
[3 replies] Last: You might consider finding an already existing 3rd party library and u... (by George PlusPlus)
Namespace std not recognized in public API.h for shared library (1,2)
 
It has been quite a while since I was working intermittently on my project to write a C++ shared library for Basex. I finally managed to create a working combin...
[21 replies] Last: smart pointers are used as an 'owning' pointer. They 'own' the allocat... (by seeplus)
Segmentation fault (core dumped)
 
Hi, I get strange segfault error when working with hierarchy of c programs (3 stages) I can give a link to the sources, but first i will describe the issue: i ...
[6 replies] Last: Thanks folks, the error was due to a buffer overflow of char array I ... (by Jonathan100)
by zzzhhh
It is known that we can't initialize rvalue reference with lvalue, but why can function name?
 
It is said that we can't initialize an rvalue reference with an lvalue. For example: int i=0; int && irr = std::move(i); int && irr2 = irr; In the above code,...
[5 replies] Last: And the standard you cited is two floors above: "http://eel.is/c++dra... (by mbozzi)
by zzzhhh
Why is const gone in the return type?
 
template <typename T> const T&& Test(T&& t) { return t; } ...... int i = 0; int&& irr = std::move(i); decltype(Test(irr)) t = i; Since there is a `const` ...
[5 replies] Last: @Peter87: Thank you for referring me to the relevant Standard. I think... (by zzzhhh)
Convert binary to base 58
 
I want to convert a long binary number, 256 bits, into a base 58 char array using c code. I cannot find a simple explanation. The Bing tool insists on convert...
[10 replies] Last: I get the same result on those 2 sites (dcode only accepts decimal inp... (by DizzyDon)
  Archived months: [aug2024]