General C++ Programming - May 2017 (Page 7)

by BulPsy
operator overload as a friend function.
 
Hello, I am currently following a book, about SDL2 game development and there is a part that I cant quite understand... This is the code.My question is about t...
[3 replies] Last: So is the way you showed me the way to do the operator overload? Yes,... (by coder777)
by Kalcor
Subscripting vectors
 
int main() { size_t n, m; cin >> n >> m; vector<string> marks(n); for (size_t i = 0; i < n; ++i) { cin >> marks ; } ...
[3 replies] Last: yes, # include <iostream> # include <string> # include <vector> int... (by gunnerfunner)
by Zapara
I can't find Source/documentation
 
I just bought the book jumping into c++ and it says I need a window that has Source/documentation, but I isn't there. Only main.cpp is there. I used mac os and ...
[1 reply] : My fail I was looking at a screenshot from an older version of xcode. (by Zapara)
va_end is undefined
 
Even after including stdarg.h, and when every other function in it works, it keeps saying va_end is undefined. Am I doing something wrong? Here is my code. ...
[1 reply] : You have used a curly bracket instead of a regular parenthesis. va_e... (by Peter87)
by Kalcor
Binary conversion with recursion
 
Hello, I was trying the binary to decimal conversion with recursion and the diff between that and the octal to decimal one too and the only difference was 1 num...
[4 replies] Last: Well, in each recursion there is an add and multiply as long as digits... (by coder777)
Problems using constants in calculations and switch statement?
 
Hey all, I am having a couple of errors all seeming to involve my variable 'wage_rate'.(Line 74 for some reason?) Errors are noted in the comments. Normally...
[3 replies] Last: #include <iostream> #include <iomanip> double request_hours() { ... (by JLBorges)
by Kalcor
Why do these 2 codes differ?
 
There is a sequence of colorful stones. The color of each stone is one of red, green, or blue. You are given a string s. The i-th (1-based) character of s repr...
[3 replies] Last: Thanks, realized I am dumb xD (by Kalcor)
by chep
help in fixing the program to make text file connected to the conversion
 
#include <iostream> #include <fstream> using namespace std; int main() { ofstream june ("ASCII.txt"); if (june.is_open()) { june ...
[1 reply] : Read the first line – the one with the headings – separately. Then... (by gunnerfunner)
by xcolz
Real estate management system
 
I really need help with this please help me out thanks . I'm trying to make real estate management program for my final project. #include <string> #includ...
[11 replies] Last: One problem you're going to run into as you try to implement your func... (by AbstractionAnon)
Linked List error
 
Hi all, I coded a single Linked list with delete function. I am using class not struct to define the node. I am getting weird error called: error: expressi...
[1 reply] : pre->Next() is a function call. The simplistic answer is that it ma... (by MikeyBoy)
Problem using constants in calculations..
 
Hey all, this is my first post on cplusplus.com: I am fairly new to C++, and am having trouble trying to convert temperatures while using constants in the equa...
[3 replies] Last: // double f_temp, c_temp, k_temp; // we don't need these globals // ... (by JLBorges)
NEED MAJOR HELP WITH THIS ASSIGNMENT
 
I AM TOTALLY LOST ON THIS ONE Write a program that generates 100 random integers between 0 and 9 and displays the count for each number. Hints: U...
[10 replies] Last: @AIRBONRE143 Sorry. I forgot to change line 18 variable, from array ,... (by whitenite1)
by Pirkk
OpenGL 0x00000000 on glDrawArrays with threads
 
I have an std::map that stores pointers to classes. I have the main program and a separate thread. I need to load files into the map from the thread, but I need...
[8 replies] Last: Well the problem had to do with OpenGL. I did not provide enough infor... (by Pirkk)
by tayyeb
help with coffee shop program!!
 
hi all, I have to create a coffee shop program where you can: • Buy coffee in any size and in any number of cups. • At any time show the total numbe...
[7 replies] Last: I think that the totalSmall, totalMedium and totalLarge are irrelevan... (by wildblue)
const conversion
 
Is it possible to do a conversion from a variable to a constant variable
[1 reply] : Yes. It happens implicitly. You can add cv-qualifiers, but not remov... (by mbozzi)
Need help with HW, payroll array using long integers C++
 
9. Payroll Write a program that uses the following arrays: • empId : an array of seven long integers to hold employee identification ...
[3 replies] Last: #include <iostream> #include <iomanip> #include <string> #include <c... (by KANATA1)
by chep
text to ascii number
 
help me am trying to create a program that converts text to ascii numbers using text file but its only reading one character #include <iostream> #include <f...
[1 reply] : One problem here is that you're assuming your computer is using an ASC... (by mbozzi)
libboost_timer-vc141-mt-gd-1_64.lib(cpu_timer.obj) : error LNK2019: unresolved external
 
Hi, I hope it is ok to post here what I believe is a bug in boost 1.64.0 or Visual Studio 2017. In a program I make use of boost timer library, and when I ...
[7 replies] Last: Hi JLBorges, I was linking to the appropriate version... but your sug... (by JUAN DENT)
Help 2 Array problems
 
I have doubts on how to do these 2 programs. Someone could help me with it and it is not much trouble. 1.Reverse Array. Write a function that accepts two int a...
[2 replies] Last: you should try to get started first before people try to help you, if ... (by KANATA1)
by erik85
Why Won't This WinExec() Command Not Work?
 
Hello once again, I am so confused and frustrated with this - I hope someone can help. The following does not work: WinExec("cmd.exe /c for /F \"token...
[2 replies] Last: I apologize for the late response. I wanted to say thank you for your ... (by erik85)
May 2017 Pages: 1... 56789... 14
  Archived months: [apr2017] [jun2017]

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