General C++ Programming - March 2015 (Page 3)

by arsy
...
 
...
[3 replies] Last: Mark all of your code. So its blue, then press the button and hit subm... (by TarikNeaj)
Ascii Code
 
I'm having a bit of difficulty understanding how and why this example works. It changes all ascii letters from small caps to big caps using this while loop... ...
[2 replies] Last: It might be easier to understand if you start by writing it: text = ... (by dhayden)
ShutDown Function for All Operating Systems
 
Hi, I'am Writing an App in C++/Qt to Plan ShutDown (or Reboot, Sleep, PowerOff..) in specific Time or Condition the problem i get is that i didn't find a funct...
[3 replies] Last: The shutdown function is indeed different for each OS. I suggest you ... (by dhayden)
loan calculation
 
hi, i really need help on program, i messed up really bad. can anyone help me. Here is what i have so far: #include <iostream> #include <iomanip> using ...
[2 replies] Last: You can just edit your post if you wanna update. Also, speaking of edi... (by TarikNeaj)
How to overwrite a specific line in a file?
 
I can overwrite the first line, but when it comes to the other lines, it doesn't overwrite. I have a password.txt that has 3 passwords in it: password0 passwor...
[3 replies] Last: +1 dhayden. That is a better approach for sure. (by Disch)
by joel b
Exception Handling
 
Good day everyone, Please i need your help with my my code which does not recognize the exceptional handling code. Here is my code but it always skips and sa...
[3 replies] Last: Agreed. You're effectively using an exception as an "else" block, whi... (by Disch)
by Addsy
Snake game
 
Hey guys I'm building a snake game for a project using shapes as food. I've created cpp and hpp files for the 3 shapes and have also created a controllable s...
[4 replies] Last: gotoxy is a function which sets the cursor point to position x,y (just... (by shadder)
How to combine three programs into one.
 
write c++ program call 'calculate number' using functions. user will choose one of the following function. A function called "callproduct" where the function re...
[7 replies] Last: lol :D (by shadder)
BFS from an input file
 
I need to create a BFS traversal on a graph from an input file given in this format. 4 1:2 3 4 2:4 3:4 4: The first line is the nu...
[1 reply] : The colon is relatively unimportant. The newline matters more. Use st... (by Duthomhas)
dev c++ problem
 
#include <iostream> #include <cstdio> using namespace std; int main() { char A ="100"; char B ="100"; cout << enter two big numbers to multiply(1-13 digits)...
[1 reply] : For code tags you must use square brackets not angular ones. cin >> A... (by ats15)
by yj1214
A question about class object
 
class Foo{ public: Foo(){ cout << "Foo()" << endl; } ~Foo(){ cout << "~Foo()" << endl; } }; class Ham :public Foo{ pub...
[9 replies] Last: But why this? Foo *foo = new Ham; this is same as saying, int *Foo... (by Gamer2015)
by yj1214
protected inheritance
 
class Parent{ public: int parentX = 6; }; class Child :protected Parent{ public: int childX = 5; }; Parent *parent = new ...
[1 reply] : Neither protected nor private inheritance allows you to do Parent *... (by TarikNeaj)
Vectors and Class
 
So this is my first time using Vectors and i have only used class a few different times since i normally use structs. By the way this is a homework assignment, ...
[2 replies] Last: Okay thank you i fixed it, i just thought since the class had a vector... (by JakeMHughes)
Calling child functions from parent
 
Hi, I'm trying to call the functions of a child class from a pointer to the parent class which are not virtual functions. Basically I'm creating a racing gam...
[2 replies] Last: This is part of my university assignment. Each GameObject has to have ... (by markmansell)
Comparing random numbers within a set
 
I was wondering if, for the purpose of a simple game, it was possible to poll an event that would effectively roll a number of dice, compare the results, select...
[4 replies] Last: Correct. Thanks for the help! I should be able to figure this out now... (by Cyberpunk Eevee)
Running a program in infinite loop until any key is pressed
 
I want to make a part of my program to cotinue in infinite loop unti I press any key. And when I release that key the programm should again go into the infinite...
[6 replies] Last: OK..thanks a lot.. (by Nikitesh)
vector template pyramid ?? iterator unexpected behaviour
 
Hi there, there is a vector pyramid as follows: template <class T> class cObject1 { public: T m_buffer; int sth; void somefunction(); };...
[no replies]
Fast Graph
 
Iam trying to load a very large text file into a graph, where all words with the same lenght and that have all letters exept one in common are conected, what wo...
[5 replies] Last: Start with all words of a given length. Sort them, starting with the s... (by dhayden)
by yj1214
Why would you use const?
 
void foo(const char *) This 'foo' function requires constant char address, right? so what do I put in this parameter? is this correct? const char x = '...
[8 replies] Last: Well, there are many reasons you might use const... Imagine you have ... (by Gamer2015)
loops
 
Write a complete C++ program that produces a table showing the temperature equivalents in degrees Fahrenheit and degrees in Celsius. Let the user enter the sta...
[6 replies] Last: You tell us. Use @Disch's Post and get started on something. Come back... (by TarikNeaj)
March 2015 Pages: 12345... 28
  Archived months: [feb2015] [apr2015]

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