General C++ Programming - November 2012 (Page 36)

by getov
Change the value of const variable
 
Hello, I've been messing around with this example for a while. I wanted to see what is going to happen if I try to change the value of a const variable by using...
[2 replies] Last: > If you do at some point take its address, the compiler has no choice... (by JLBorges)
Random number generator with range don't work.
 
#include "stdafx.h" #include <iostream> //to use cout and cin and endl// allows using cout without std::cout #include <string> // to use string data type #i...
[2 replies] Last: Great. That worked. I thought the number after "%" was max value and t... (by manish111)
Help on comparing two strings
 
#include <iostream> #include <fstream> #include <cstring> #include <string> using namespace std; const int max_cpl = 250; //max characters ...
[no replies]
need to find the median of a dynamically allocated array
 
I am new to C++ and am struggling with it. I have a homework problem that requires that I make a dynamically allocated array, calculate the average and then f...
[6 replies] Last: Ah good call. Didn't account for that (by ResidentBiscuit)
How can I get the expected outputs for this C++ program?
 
Define a getScores() function with the specification and prototype shown below: // Get scores from console and return the number of scores recorded. // A ...
[17 replies] Last: Checking compiler warnings might help you figure it out. (by cire)
simple text based car racing game
 
Ok so I have to make a simple racing game where the user inputs 1, 0, or -1 for the increments in horizontal and vertical acceleration/deceleration to guide the...
[no replies]
Allegro 5.0.7 on Code::Blocks
 
i have spent the last 3 weeks and countless hours trying to get allegro to work on codeblocks, ive read nearly every other 'help' discussion i can find, and non...
[14 replies] Last: tremendous! man thank you soooooo much! (by Naughtyusername)
by HJH
Julian Date C++ Program
 
I need some assistance with my code for this problem. Write a program that determines the day of the week for a given date. You can invent your own complex ...
[4 replies] Last: Thanks, I added the tags. No you didn't. Change it so it looks li... (by TheIdeasMan)
by Morg
Is this a good way to use a string for int operations?
 
I'm trying to use a string like an int as well as a string. For example, I have to pass my string through a for loop. My code works, but I get the nagging feeli...
[2 replies] Last: I can understand wanting to do that with a char, but not a string. A ... (by TheIdeasMan)
How Can I Know The No. Of Digits in C++ ???
 
Write a program to do the followings: • Read a number from the user ( N1 ), and check if it exactly has 3 digits. • Read another number from the user ( N2...
[4 replies] Last: ooh really thank you that's mean a lot <3 I have an exam Tomorrow tarr... (by Sentiiiment)
setting precision in between calculations
 
I'm trying to write a program calculates various things for a train company. Two of the things I'm trying to calculate are amount of ore in a mine and amount of...
[no replies]
by BandK
char array
 
How to sort CHAR arrays from linked list?
[5 replies] Last: If you want to adapt your current code, and compare your name char ... (by Catfish2)
Extending a class of the library
 
Hi, i am using ProBT library. Now i want to extend the functionality of a class "A" of the library. So, if i declare my class B as a subclass of class A, and wh...
[4 replies] Last: Yes i can do it without any error. (by amanyasin)
Using 1D array for bowling scores
 
Hey y'all- I'm trying to write code that will display scores of a bowling game with both the score per frame and a running total score of the game, like this...
[5 replies] Last: Line 45 shouldn't be using <= . Line 51 shouldn't be using scores ... (by cire)
by k33n
Function not returning anything
 
I have two functions: checkCollision feeds an array of SDL_Rect into actCollision , which checks and and changes the values based on certain criteria. The p...
[6 replies] Last: the only function that should be returning data is actCollision , whi... (by k33n)
Qt Toolbar Question
 
I am working in various Linux distributions, which may or may not be relevant. I have a QToolBar containing QToolButtons. One of the button labels toggles bac...
[no replies]
C++ help
 
I don't know where to begin with this program. General Information This application sort occupations by salary and prints a sorted table. It also calculates...
[8 replies] Last: It gives you sample files. Just think of 20 jobs and give them arbitra... (by ResidentBiscuit)
Needed best of the best!
 
I will be starting a new company, and I am need of the best programmers around. There will be no immediate compensation; however, I am willing to offer share...
[7 replies] Last: Thanks to everyone who has replied to me via email and the forum. Duoa... (by jbringley2)
Returning number of characters without using strlen
 
Hey guys. Ive ran into a little bit of a problem but have a hard time getting around it. I have to create a c++ program counting the numbers characters in a str...
[12 replies] Last: I never thought that this task is such hard.:) unsigned int StringLe... (by vlad from moscow)
Getting sizeof(an int)
 
in ascii character code line feed (LF) is 10 in decimal or 'a' in hex. if I have int C; C = 10; how can I get sizeof(C) but I need C to be the hex val...
[7 replies] Last: I appreciate all the hints, now I am able to go on the right direction... (by mendozae)
November 2012 Pages: 1... 3435363738... 51
  Archived months: [oct2012] [dec2012]

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