General C++ Programming - March 2013 (Page 17)

rendom number genrator decimal to binary system 0 to n
 
#include <iostream> #include <stdlib.h> using namespace std; long decimal(long); int main() { long dec,ren; cout<<"Enter the decimal to be conver...
[1 reply] : What is the question? (by buffbill)
by Ecrosh
Help me DMA and sorting strings
 
Hi, I am supposed to use Dynamic Memory Allocation to create the names and scores arrays, but I am not sure if I did it right or not. Also, I can sort the score...
[1 reply] : You are sorting scores but not names. BTW if you used code tags and so... (by buffbill)
by Phiru
new and new again?
 
I just came up with something about new keyword. here's code. int *a = new int ; for(int i =0; i< 10; i++) a =i; a = new int ; then, I printed all,...
[2 replies] Last: Ya, you're right. I tested it, then second a(new int ) refer to diffe... (by Phiru)
Snack Vending Machine help. (1,2)
 
Hello, everyone. I'm currently trying to program a vending machine for a class that accepts a pin number 5 numbers long (else it'll loop till a proper pin numbe...
[22 replies] Last: Um, no. You're still trying to define a main function that takes 7 ar... (by MikeyBoy)
multiple classes program help needed
 
Hello, i need a c++ code that uses more than one class with all the features like constructs/destructors, aggregation/composition, new/delete so on. i need a ...
[2 replies] Last: Go back to Beginner's Forum (by closed account jyU4izwU)
fstream help
 
I got one version of C++ program that hotel booking or check in whatever you call. see the program below. Now I want to modify this program with "Struct" and ...
[1 reply] : continued function void get_Menu_input(char &choose,string h ) { ch... (by slmbj06)
Why the eof is never recognized?
 
#include <iostream> #include <fstream> #include <stdexcept> #include <vector> using namespace std; struct Point { double x, y; Point(double i...
[14 replies] Last: Oh, i didn'd know this. My compiler hadn't given me a warning. I also ... (by nuderobmonkey)
Const variable operation error
 
I've created a class of complex numbers and defined operations. I've also defined the imaginary unit i as constant in a namespace. When I write complex z(0,...
[3 replies] Last: You have no operator defined for operator + (int, complex). Hence, the... (by firedraco)
Graphics.h or QT
 
My project is not a game, but regarding graphics it requires an image editor(with not much flexibility). And I have previously used graphics.h but our course in...
[4 replies] Last: thanks . very helpful :D (by Mustehssun)
by nawgee
Need help figuring out error
 
Hey guys, I was wondering if you guys could take a look at my code. I am trying to simply implement Bubble Sort, but I am having trouble getting it to compile. ...
[3 replies] Last: #include directive executed by preprocessor and basically means "copy-... (by MiiNiPaa)
Can Someone help on this it would be grateful
 
Hi Below is my code #include <iostream> using namespace std; template <class T> class OrderedCollection { // ================= c...
[7 replies] Last: The problem with your code, other that the line indicated is not valid... (by jlb)
output understanding help required
 
What will be the output of the following program segment: int a = 3; void demo(int x, int y, int &z) { a += x+y; z = a+y; y += x; cout<<x<<'*'<<y<<'*'<<...
[1 reply] : OK... before the first call to demo, ::a is 3 a is 2 b is 5 so on in... (by MikeyBoy)
memory clearing
 
how would i clear all memory at adress b8000
[4 replies] Last: just to let you know its for OS Dev (by James Parsons)
Making a moving item controlled by using WASD
 
Hey guys, I'm new here, but so far I like this place :) Okay so for the problem: I'm working on a personal project with a screen that looks like this: ++++...
[2 replies] Last: ah thank you! this made my life easier :) (by NarWhat)
Red Alert. The greatest strategy game of our childhood?
 
Hi, maaassive question to ask. After they release Red Alert 3, Electronic Arts released the 1996 PC game 'Command and Conquer: Red Alert" as Freeware. The or...
[2 replies] Last: Interesting! I'll look into this. But where do you think you can get t... (by benduncan87)
Aligning output using setw
 
I'm trying to align my output but I can't get it to look perfect. This is how it looks like in my program: -------------------------------------------------...
[5 replies] Last: But does it matter if you have right or left before setw() compare to... (by ajh32)
Reading .txt file into program
 
I'm working with parallel arrays, one handles the titles and the other handles the ratings. Now everything works fine if the title doesn't start with a number, ...
[3 replies] Last: I have resolved my previous question but have updated the first post w... (by danielmtnz)
How to read from a file then display to console?
 
I am stuck on a problem. It asks me to : Write a program that reads from total.dat file and displays its contents to the console. The program should allow the ...
[1 reply] : http://www.cplusplus.com/reference/fstream/fstream/?kw=fstream Everyth... (by tath)
Using Reference with virtual method
 
Hi, #include <iostream> using namespace std; struct A { virtual void f() { cout<<"A\n"; } }; struct B : A { void f() { cout<<"B\n"; } }; int...
[12 replies] Last: If it helps, I recommend never using the = sign for declarations/initi... (by LB)
Please help need help in a question of programming using switch statements only nothing else
 
Write a program which asks the user to enter a number and determine whether the number entered is prime or not and also determine whether the number input by us...
[2 replies] Last: the thing is that its an assignment i have in which we r only to use s... (by kenshin92)
March 2013 Pages: 1... 1516171819... 51
  Archived months: [feb2013] [apr2013]

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