Beginners - May 2011 (Page 2)

Result not changing
 
#include "stdafx.h" #include <iostream> #include <limits> using namespace std; int main () { int a, b; // declaring variables int result; a = 5; b = 2...
[6 replies] Last: @ Shacktar, I dunno dude, it said it was compiling. But it is most lik... (by PraxxtorCruel)
File Compresor
 
Hey folks, I need some help in my program for compress files based on code of huffman. I only can compress .txt files, and uncompress later exacly equal the or...
[1 reply] : Your code is not compressing/decompressing correctly, causing file cor... (by h3432)
HELPPPPPP
 
Hello, i am doing a class in Problem Solving with C++ and am having difficulty with a problem. I have written the code but it is not building. I am using M...
[3 replies] Last: There's a whole sticky thread on this: http://cplusplus.com/forum/beg... (by Disch)
by llVIU
polymorphism
 
I need to alter a class, to make it from "<<KG*10" to "<<KG*100", very simple, however KG returns with the max value as if it wasn't given a value (on KG*100) ...
[9 replies] Last: The need for downcasting is actually quite rare and using it is usual... (by shacktar)
error C2061: syntax error : identifier 'fstream'
 
trying to write to my output file in a function but it shows this error Snips of code, #include <iostream> #include <ctime> // Needed for Random number #i...
[1 reply] : Just from looking through, here's what I notice: You #include fstr... (by Danny Toledo)
For some reason, my if statement never runs.
 
In line 26, Spassword and password never match. It always runs the else statement. #include <cstdlib> #include <iostream> using namespace std; int ma...
[2 replies] Last: Thanks, I didnt know that. (by kyranstar)
Makin' Change
 
I've have a project due this week and I'm having trouble with a specific section of my code. The exercise is titled "MakeChange" and I am to design it so that ...
[3 replies] Last: Secondly on line 3 I have it listed as a "double" but then as an "int"... (by RayHanz14)
Adding user acounts to current game
 
I have made a game that I now want to add a user account like system to it. I would like it to keep track of name, username, password, and wins but I'm having a...
[5 replies] Last: Well, what you could do is this: 1) Create a simple menu that allow... (by closed account zb0S216C)
Don't understand exactly how char * months[12] works
 
I think I have a pretty good grasp on pointers and arrays and all that stuff, but this statement is confusing me: char * months = {"January" , "February",...
[2 replies] Last: Oh, I see. I would have never thought of it that way, but it actually ... (by Kieth89)
by Guluck
Explanation
 
Hi everybody, someone could explain me what the following code do ? And more particularly the functions or writing: - getopt - strcpy - the arrow in: die...
[2 replies] Last: Thanks a lot. (by Guluck)
Help needed on a quick, easy-to-solve program
 
Hi everyone! I have a simple problem in C++ that I really need help solving. I generally solve these things by myself but the problem is I was away from home...
[6 replies] Last: I can help with functions. A function is a chunk of code, as you know.... (by lfnunley)
sizeof struct with one member
 
hi everyone... I've got a question aboute sizeof a struct in C++. I am reading Stroustrup's book and it is said that the sizeof a struct not necessarily equal...
[3 replies] Last: Yes, when you have a struct containing a single field of type double, ... (by webJose)
by tonnot
How to store char (byte) buffers into a vector?
 
I have some char (byte) buffers and I want to store them into a vector How have I to declare the vector ? Basically I want to do a 'pusback' something like ...
[3 replies] Last: The allocator is an object responsible for providing memory to the vec... (by webJose)
C or c++ (1,2)
 
Be honest. C can do everything c++ can right? I wanna be able to develope OS, programs that speed up internet, graphics and stuff. I heard the mother of all gra...
[22 replies] Last: I can't say I remember exactly what it was but I remember it being lik... (by Computergeek01)
by tonnot
About iostream and buffers and arrays and vectors and the ways to communicate all of them
 
I dont know how to do the work: Basically I want to have a method to 'fill'and retrieve memory data using buffers .( char or byte buffers ). I want to read an...
[no replies]
Redefinition Error with CFree5!
 
I tested the Chapter 16's code from "C++primer"(4 Edition) in CFree5, but got redefinition errors. Here is the inclusion relations: file:MS_Queue.h #ifdef ...
[10 replies] Last: I had a similar problem but I had declarations and definitions in one ... (by caballero)
Class Problem
 
I cant really understand why im getting a ambiguous error in line 97. Can anyone tell me what i did wrong and how to fix it? Heres the code: #include<i...
[3 replies] Last: Fraction.operator*(n1,d1); What are you trying to do here? First ... (by freddy92)
OpenCV DevC++
 
I am new to programming c++. I am using DevC++ 4.9.9.2. I am trying to use OpenCV 2.2 with it. I need to use both DevC++ and OpenCV on several different compute...
[5 replies] Last: I looked around on various forums and opencv's site, but I couldn't fi... (by mitadya)
by GUY25
How to check if string does not equal something
 
Hi Guys, Just trying to make a program and have encountered a problem. I'm making an if statement and basically I want: if (string does not equal "BLAH...
[9 replies] Last: This is just a nitpicky thing, but most of us prefer to read the code ... (by lfnunley)
Mysterious Error from simple code...
 
//mrs decompiler #include <iostream> #include <windows.h> #include <stdlib.h> #include <fstream> using namespace std; int main() { SetConsoleTitle("...
[4 replies] Last: I fixed all of the errors. Here is the revised code if anyone would l... (by Rwkeith)
May 2011 Pages: 1234... 48
  Archived months: [apr2011] [jun2011]

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