General C++ Programming - August 2017 (Page 3)

UVa 562
 
Hi, I've coded the solution to UVa 562: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=503 After debugging ...
[1 reply] : Alas, I hate that site. It is broken in too many ways and, even though... (by Duthomhas)
if statement inside for loop not working
 
The output of the below code should be the numbers between 21 and 29. But the output is numbers between 15 and 30. Where is the mistake? Why is if statement ins...
[1 reply] : if(20<i<30) This is not the proper synthax. Should be if (i > 20 && ... (by Thomas1965)
How to clear C++ console?
 
Project is Calculator. If user enters the input 1 + 1 = 2 and if user presses any key again, then console clears/refreshes and starts again like, enter the firs...
[8 replies] Last: /* --- Function: void my_clearscrn(void) --- */ void my_clearscrn(v... (by pivot)
Horizontal, vertical lines & their alignment
 
Hello, I succeeded in getting to show all 255 ASCII symbols in a table, but have a couple questions. First, how I could make a vertical line appear before 0,8,1...
[17 replies] Last: Thanks lastchance for explaining! Also thanks Cobbi for finding a way ... (by aurimas13)
constructor & destructor
 
Hi guys, Please help me I need a program any program which includes default constructor, copy constructor,parameterized constructor & destrutor. Thanks
[1 reply] : We are not a code writing service. If you want to learn programming, m... (by Thomas1965)
Code::blocks calculator, help me fix this.
 
Full code here, #include <iostream> #include <windows.h> using namespace std; int choice; double value1, value2, result; int main() { HANDLE h = ...
[6 replies] Last: But now, can how can I make it like that? If user calculates the numbe... (by Kristen)
to get the specific results at the different time steps.
 
so i need a bit of guidance. i have a program that outputs results in several time steps in a text file. what i want to do is get the specific results at the di...
[7 replies] Last: you can also install cygwin and cut the windows path to see the execut... (by jonnin)
setting up SDL2 with codeblocks
 
Hi, I am trying to learn to use the SDL2 using the tutorials at, http://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/codeblocks/index.php I was successfu...
[3 replies] Last: One option would be to create a project from scratch and save it as a... (by Thomas1965)
by Borneq
PDCurses and C++
 
I try using PDCurses to write Windows/Linux program. While using PDCurses in Windows in .C programs is easy, I can't use it with C++ program. Problems are conn...
[1 reply] : Solution: instead of http://gnuwin32.sourceforge.net/packages/pdcurses... (by Borneq)
Comparision of ofstream object and double/integer variable in If statement
 
I am writing a program in C++ in which I need the comparsion of ofstream object with a double/int variable but the compiler gives me error that 'No operator == ...
[6 replies] Last: Thanks, it worked. (by Saeed Ullah)
by Kip
Initialization of base class in derived's copy constructor initialization list
 
Compiling the following minimal.cpp with g++ 6.3.0 like so: $ g++ -Wall -Werror=extra minimal.cpp -o minimal If the base constructor in the initializer li...
[3 replies] Last: Thanks folks. I suspected that it was a best practise to invoke the ba... (by Kip)
by thmm
Libraries vs applications in C++
 
Scott Meyers said in one of his talks at CppCon sth. like "C++ is great for libraries but not for applications. Unfortunately he didn't explain why. Could some...
[2 replies] Last: I would say it is the portability issue. A library with no direct I/O... (by jonnin)
by stav
GUI library other than QT?
 
What GUI library do you guys use when creating GUIs with UI elements and what not? i've been thinking about using QT, but it seems that its not free anymore, a...
[1 reply] : It is still free. https://www.qt.io/download-open-source/ You don't ... (by Moschops)
by elsa
How to double numeric value from a string read from console
 
Here is the code in question: it can read from the console and parse the string, but I want it to parse the string with initial numeric value doubled. For examp...
[4 replies] Last: Avoid using a custom regular expression to parse floating point number... (by JLBorges)
n natural numbers
 
asaalam o alaikum frndzz.. what is the c program for first n natural numbers???
[6 replies] Last: Glad you got it! Loops are one of the most important control construc... (by Duthomhas)
HELP PLEASE!!!!
 
The file extracredit.txt contains a list of integers. Each integer is 4 digits long. (Range would be 1000 - 9999). Write a program that will read each integer...
[3 replies] Last: Also, tae a look at these 2 functions, the app function adds 0 or 1 to... (by masecla33)
Edit data with .txt file using ID
 
Hi, i just started C++ 2 days ago and still learning how to code. How to do edit database by using ID number? For example i have a data text file called sports....
[6 replies] Last: the addSports() function is on the right track but there are a few sim... (by closed account 48T7M4Gy)
Undesired output when reading a file
 
Hi Guys, I am reading from a file and printing the content on the console. But my output contains blank lines between each line of text. i nt main() { char bu...
[2 replies] Last: fgets() will treat the newline character as part of the line. http://w... (by Chervil)
How to declare a pointer to a fucntion which (function's) return type can be different?
 
I have a class with a member data which is a pointer to a double function: //.h file class A { protected: double (*ptrToFucntion)( double );...
[6 replies] Last: The problem runs deeper than that: you are basically asking the compil... (by Duthomhas)
Program doesn't print the bank account balance afteral, why?
 
#include <iostream> using namespace std; //cola machine! int main() { int num; double bankAcc = 2.00; cout << "FOO, What do you want: 1) coke,...
[2 replies] Last: #include <iostream> using namespace std; //cola machine! int main... (by KANATA1)
August 2017 Pages: 12345... 9
  Archived months: [jul2017] [sep2017]

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