General C++ Programming - March 2019 (Page 5)

How can we explain the following behavior of c++ code ?
 
Hi, I am finding it difficult to understand the following c++ code behavior. double dz = 23.4; int* p = (int*)(&dz); *p = 432344332; std:...
[4 replies] Last: Your case 1 does change. But not by much. Anything you do to the lowe... (by salem c)
Use a file to manipulate a variable.
 
I am doing a school project on making UI for an atm machine. SO my question is how can I use a variable such as 'CURRENTBALANCE' be manipulated by the informati...
[3 replies] Last: I guess you detect the failure to open the input file, and assign a va... (by salem c)
LoadImageW returns NULL
 
This is a simple windows application made with windows.h. I wanted to add an ìmage to it, but the LoadImageW function returns NULL and the image doesn't show u...
[5 replies] Last: Do you link to gdi32.lib? (I think that is the one you need) ... (by closed account z05DSL3A)
A basic C++17 text adventure engine
 
I'm using Code Blocks 17.12 and want to work on a text adventure game. I'm looking for a simple system that I can mod and make my story come to life.
[1 reply] : Duplicate post: http://www.cplusplus.com/forum/windows/251141/ (by closed account E0p9LyTq)
Problems with std::string.replace()
 
I'm trying to write a function, which replaces all occurrences of a std::string with a different one. Naturally, I tried using std::string.replace() as a fi...
[1 reply] : Try... #include <iostream> #include <string> void Func (std::string&... (by closed account z05DSL3A)
Bank Account Coding Issues
 
Hello, I'm having a hard time figuring out what to do for my bank account program. I haven't gotten far into it, but I have several problems/issues with my code...
[1 reply] : 1. I have to load and save all the data to and from a binary file, but... (by salem c)
Texas Instrument CC1350 UART for RSSI signal strength
 
Hi, i currently have an UARTecho that is working and the current code is as follows else if(e & RF_EventRxEntryDone) { /* Successful RX */ bRxSuccess =...
[8 replies] Last: I've no idea about the mysteries of your 'display', or what might be i... (by salem c)
Should we have one class for each responsibility in c++ ?
 
Hi ppl :), My question is : Should we have one class for each responsibility in c++ ? Consider an Eg. of Library Management System, we can have a design w...
[4 replies] Last: Thanks @dhayden and @Repeater for your inputs :) (by kapil2905)
Newline in istream
 
I have the following code and was wondering if there's a function that can be used in istream that will give a newline in output. For instance, having a newline...
[5 replies] Last: As ne555 already pointed out, input and output are not the same thin... (by Duthomhas)
Print newline for anything but numbers
 
How to write an if statement that prints a new line for any line in a file that does not start with a number?
[1 reply] : if ( !isdigit( str ) ) cout << '\n'; (by lastchance)
I am trying to use a list and iterate through it to find a word and delete the word from the list
 
I am trying to use a list with a hash table to find an occurrence of a word and delete it from the table. The hashtable list is initilized as list<string>::hash...
[1 reply] : ¿do you have a connection between the end of each list and the beginn... (by ne555)
No Match for operator>>
 
I need to implement istream outside of class and without friend. I keep getting "no match for operator>>" error. class Dot { public: void PutName (c...
[2 replies] Last: I figured it out. I included a print function in my class and called i... (by darkknight914)
Overload Operator
 
I need help overloading operator for the following: class Dot { public: void PutName (const char*); void PutBarCode (uint32_t); void PutCost (float...
[4 replies] Last: Every time I included outside the class without friend, I get a "no ma... (by darkknight914)
by ujwala
SQLHSTMT with DB2
 
Hi All, I am using DB2. I want to know if there is any way/api to get the query string from SQLHSTMT handle passed to SQLEXecute(). Thanks in advance
[no replies]
by elsa
add/display functions not working
 
This add function is supposed to return the sum of the 5 values of the iterator. It is not doing so. I'm getting a value of 0. Also, the display function is not...
[6 replies] Last: I solved it. Thank you. #include<iostream> #include<string> #includ... (by elsa)
by WildB
Having trouble duplicating a hexagon array in another array horizontally
 
I made a simple array to produce a hexagon-like shape within another array. However, everytime I output the array it come out vertical. I need to duplicate the ...
[7 replies] Last: Thanks (by WildB)
Simple Craps program
 
So I was working in this small program to run over a million times this game of Craps. However, when my rolls in my arrays wins and losses are even, the resul...
[2 replies] Last: Line 18-19: wins and losses are uninitialized (garbage). unsig... (by AbstractionAnon)
Need help with a DNA to mRNA transcription code.
 
I have a project where i have to read a DNA sequence from a file and print to the console its mRNA counterpart. Here is the question: Your task is to write a...
[1 reply] : Double posted http://www.cplusplus.com/forum/beginner/251029/ (by salem c)
That error for distributing c++ based ".exe" files
 
I am sure you're aware of the "MSVCR140.dll"/"MSVCR110.dll"/"MSVCR100.dll is missing" error. I ask, is there one single download one can make to remove all thre...
[7 replies] Last: If you used VS2017 to compile the program, and all of its parts, it ha... (by closed account E0p9LyTq)
Implement function templates
 
Need help implementing prototype. Data gives the data in the range [init, final) to standard output. If the output formatting character ofc is '\0' then the out...
[3 replies] Last: This loop iterates through the sequence (from begin, up to not equal t... (by JLBorges)
March 2019 Pages: 1... 34567... 9
  Archived months: [feb2019] [apr2019]

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