General C++ Programming - May 2020 (Page 5)

Structure with Pointers, Not getting any output with this code
 
Write your question here. Here I am trying to use MyTime struct for calculating time between two time entered by users. I am compiling it and it ask user to...
[7 replies] Last: Both are awful in modern C++. I thought I'd elaborate on Salem C's p... (by dhayden)
Dynamic memory allocation problem
 
Write a program in that file to obtain nutritional information about several foods from the user then display a table containing this information. The number...
[5 replies] Last: A good place to start is with your requirements pasted into the code a... (by salem c)
C++ Programming // Beginner
 
I am somewhat of a beginner in C++ and I would like to devote more of my time to programming in general but since I usually give up if I am working alone I deci...
[3 replies] Last: I am here for you, but ps i prefer to create account in github and lea... (by lablnet)
static data member in class
 
When I have define getInstance() function inside class I am not getting any error for the static data member static single* ptr. class single { private:...
[12 replies] Last: C++17, what can't it do. :) (by George P)
how can I apply the "USER-DEFINED FUNCTION" in this source code?help me pleasee
 
//UNIVERT #include <iostream> using namespace std; int main() { //VARIABLES int cm, inch, mile, kilometer, meter, foot, pounds, kg, yards, metre, gram...
[3 replies] Last: I'll suggest a different function. The code for each conversion is alm... (by dhayden)
by doggi
How to implement class dynamic_string, based on the interface
 
I have such interface and need to implement dynamic_string. But I am not a C++ pro and don't know how to do this. Please, help. Thank you in advance. template...
[15 replies] Last: You are very welcome! :) (by highwayman)
Where i can learn C++ Processor magics
 
Let considered this URL https://stackoverflow.com/questions/1113409/attribute-constructor-equivalent-in-vc here are the code that i grab from their #ifdef __...
[10 replies] Last: Thanks you so much all (by lablnet)
by qwofer
How to connect different parts of the application?
 
Hi! Im trying to make c++ programs. When my program starts, program creates 2 threads: -- in first thread (LoginScreen class) goes main program loop. Thi...
[2 replies] Last: Make the data visible to both threads. how? (by qwofer)
File writing code not working properly
 
Okay, so my issue is I have most of the following code written, but it isn't working as I need it to. I am supposed to check a list of states in a separate file...
[4 replies] Last: Well, thank you for your help. (by Knellith)
Accessing singleton class instance
 
I am trying to understand different ways to access singleton class instance. Whats the right way to access singleton instance. test.h class test { pri...
[3 replies] Last: Why use a pointer at all? test.h class test { private: test() = ... (by dhayden)
CPU Memory? im not sure what the problem is :)
 
Hello guys, im building a game in sfml. in the loadLevel class i create 20-40 objects and push them into vector. use them in vector to group them and i create...
[9 replies] Last: Also, it looks like you can replace the switch statement with a bit of... (by dhayden)
Hierarchical Mutex Questions
 
Solved
[1 reply] : You've accepted that when you unlock 10000 the value will go back to 5... (by helios)
Need suggestion on referance vs pointer
 
New to c++ and i have confusion about whether aObj should be a referance or pointer here. Basically in the main program an object of class B will be created and...
[2 replies] Last: thank you so much for the clear explanation (by Scarletpimp)
Functions with C++
 
#include <iostream> #include <math.h> #include <string> using namespace std; int golf(); int hotel(); int main(){ hotel(); } int golf(){ sra...
[5 replies] Last: #include <iostream> #include <cstdlib> #include <ctime> using namespa... (by lastchance)
Rock paper scissors, program not recognizing userinput and getting same answer everytime
 
#include <cstdlib> #include <ctime> #include <iostream> #include <string> using namespace std; int main(void) { srand(time(NULL)); int randnum = ...
[5 replies] Last: Sorry about that. I'm new to this. (by Programmingaddict)
.csv NOT loading when running exe file of project
 
When I run my project in a Debugging environment, all the data point imported via .csv file are read properly. However, when I build the project and run the exe...
[1 reply] : Without seeing your code, can only guess. Perhaps there is a differen... (by jlb)
segmentation fault !!!
 
hey, In the main part, I get the segmentation fault error while going to the next part of check_number function,
[2 replies] Last: Also, the reason it is segfaulting is because you are dereferencing th... (by TheToaster)
unsigned char range
 
The range for unsigned char is 0 to 255. Then why output for below program exceed to 255? int main() { printf("Hello World"); unsigned char s ...
[2 replies] Last: Yes I got it. Thanks Repeater for reply. (by akash16)
What does “state” mean in C++?
 
https://en.wikipedia.org/wiki/State_(computer_science) might help. EDIT: The OP was deleted...
[11 replies] Last: Oh, cool, the OP is a "change the text so we can add a spam link" spam... (by George P)
by frek
Concrete Classes
 
Hi, I have this text from Bjarne about Concrete Classes, but I can't understand it completely especially from the part starting from "The defining characterist...
[6 replies] Last: The representation is what which is to be represented. So in the concr... (by frek)
May 2020 Pages: 1... 34567... 9
  Archived months: [apr2020] [jun2020]

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