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)
C++ Questions (1,2,3,...,9,10,11,12)
 
1) Why does "&myChar " act differently in 2 different contexts? char* pointer = &myChar ; //ALSO WORKS!!! Above, it actually return the address of ...
[226 replies] Last: [quote=seeplus]Well you'll really like APL. This one line of code remo... (by mbozzi)
by Ch1156
When to use const class member variables? (1,2)
 
So while doing something, I made a member of my class const, and i got errors, upon some cursory research I found i need a copy constructor, and to define my ow...
[21 replies] Last: Ok, so its perfectly ok to use static const, and to make it non copyab... (by Ch1156)
lest shift an u8 array
 
Hi. I have an exsiting u8 array in a function (function that get u16 array as argument). How can i create a new u16 array the starts from 3th byte of an existi...
[2 replies] Last: what you had is probably close. remember that c++ starts at zero. th... (by jonnin)
const keyword in function declaration
 
#include <iostream> #include <iomanip> using namespace std; const int NUMCOLS=4; const int TBLlROWS = 3; const int TBL2ROWS = 4; void showArray ( const...
[2 replies] Last: thanks buddy (by hassan236)
size_t implicit conversion
 
Greetings! I have a loop that doesn't want to break when it should. for (int i = Xdata.size() - 1; i >= Xdata.size()-B; --i){ // loop body ...
[17 replies] Last: I swear I’m getting senile. I'm getting there first. :|... (by George P)
operator const char* return (1,2)
 
Hi y'all i was wondering if i can have something like this on one line? return (ss.str().c_str()); or return ((ss.str()).c_str()); operator co...
[39 replies] Last: If I were to start using command-line compilation I would probably go ... (by George P)
ASM code and C++
 
Hallo, cplusplus. i am trying to get a bios interrupt call to the bios in c++. but compiling it i get a error.. kernel.c:27:9: warning: implicit declar...
[3 replies] Last: OP is clearly not messing with programming on modern systems. Hints: ... (by Duthomhas)
Looking for tutor for OOP class
 
Hi everyone, I dont know if this is the right channel to ask this but im starting to fall behind pretty hard in my OOP class, I really need to catch up on a cou...
[3 replies] Last: I can help you out with what I know currently. Tag me if you are inter... (by CodeChaser)
Launch A Program
 
I'm working on my GUI game framework (SDL, Linux Machine). I have a keyboard shortcut that sends things into edit mode, and I want to have an edit option attach...
[3 replies] Last: That's great, thank you. (by newbieg)
How to ensure log folder is created before any log calls are made?
 
The actual code I'm working with is complicated (and something I can't post) so I'm going to use a proxy example. I have a Visual Studio Solution that contain...
[5 replies] Last: Logger.h does serialize writes to the logfile. There is a utility fun... (by kigar64551)
split 32 bit variable to array of 4 u8 variables
 
Hello. How can I split (using pointers) u32 variable to array of 4 u8 ? I tried this: u32 data = 0x12345678; u8 * data_8_bit = (u8*)&data; But ...
[6 replies] Last: For the cast to be correct, u8 must be another name for unsigned ch... (by mbozzi)
Visual studio keep aligning assignment operator
 
Hi, I want to turn off this type of formatting someLongVariable = false; shortVar = true; I prefer this someLongVariable = f...
[1 reply] : found it. In text editor | all languages | tabs | indenting -> check b... (by rudiHammad)
by Mif
C programming / Program is Crushing when in release
 
I got this Unhandled exception when I try to run my program in release mod. I don't know what am I doing wrong, and I can't find where I'm exceeded the array bo...
[12 replies] Last: Also here sortAndFindMax(propValue, 5); I'm sorting the array and th... (by Mif)
Linking problem with qrcodegencpp [Linux]
 
Installing a new library and future its compilation is always pain for me. I've just installed simple lib: https://www.nayuki.io/page/qr-code-generator-library...
[4 replies] Last: >> /usr/lib/x86_64-linux-gnu/libqrcodegencpp.so.1 > This one looks lik... (by keskiverto)
Pointer to array in 2d array
 
Hi folks. I have certain function (in .cpp source) that takes a pointer to an array of 8 integer values. (The function is responsible for creating a Minor - ter...
[6 replies] Last: Ah, yes, you ran into magic VLA stuff. Fix that by cranking up your c... (by Duthomhas)
Git questions
 
Hi. Can I ask here git questions?
[2 replies] Last: That git-scm website has lots of git flavors for the 3 big OSes. If y... (by George P)
Container questions (1,2,3)
 
Just read and practiced my vector/deque/list/forward_list/set/multiset containers and I wondered about this one. 1) Why did they make it so that a set is REQ...
[51 replies] Last: A compile time check would be one of the NP complete problems I believ... (by jonnin)
Shared variable between thread(ISR) and main()
 
Hello folks, I want to create a variable that will be shared between a thread (ISR) and main() I am working on embedded environment on linux os Basically...
[8 replies] Last: Second, I learned about circular buffer. I wonder if it is suitable ... (by kigar64551)
  Archived months: [feb2024]