Beginners - February 2011 (Page 21)

by vladi
Dynamic Allocation with array of Pointers!!!!
 
it is crashing when allocation memory. This is hard;/ HERE IS THE PROGRAM:::: ////////////////////////////////PROGRAM REQUIREMENTS/////////////// Write a pro...
[4 replies] Last: thanks I figured it out! closed! (by vladi)
Declaring Variables Problem?
 
I need to declare a variable, without simply stating what it is? Is there anyway to do that? Why I need to is I am making a text game, so when the player fights...
[5 replies] Last: My code allows you to do this. int dmg = weapons * (rand() % 10);... (by Zaita)
(error) Re-Multi dimensional array vectors
 
#include<iostream> #include<vector> using namespace std; //initially 9 * 16 #define HEIGHT 9 #define WIDTH 20 class CTile { public: CTile() { ...
[1 reply] : http://www.cplusplus.com/forum/articles/1295/ (by Zaita)
header file problems
 
Hey, So, I am trying to link two files. The problem is with print() Error 1 error LNK2005: "void __cdecl print(void)" (?print@@YAXXZ) already defined in sco...
[1 reply] : You need to declare print() inline if you are going to implement it in... (by jsmith)
Convert string to const * char for ofstream.
 
So I am just playing around, changing things to see what happens when I do (I learn this way). I know this isn't how one should do it, but I wondered how I cou...
[3 replies] Last: I figured it out. Remember I was just playing around trying to learn ... (by cppmatt)
by LtLeo
While Loops for my Text RPG
 
I am trying to make a Text RPG game, But I can't seem to get do while or while to work. Here is my code. #include <iostream> #include <string> #include ...
[6 replies] Last: I hate working with cin. Anyways, here is some code I tested that work... (by Zaita)
Switch not working propperly
 
I'm trying to create a program for scoring a blackjack hand. The program asks the user how many cards they have in their hand (2, 3, 4, or 5). And depending on ...
[3 replies] Last: Thanks very much. I forgot to add in the cin >> card_1; and etc. I ... (by Cheatlancer)
syntax
 
// Keith Lin & Chris Baldwin - Feb 14 2011, computger applications 2 dimension vector // the purpose of the program is to overload the + and - operator for ...
[1 reply] : This will compile fine for me, but it warns me about the possible loss... (by Zaita)
my program
 
//extra credit // Operator Overloading #include <iostream> using namespace std; class Numdays { //beginning of class p...
[1 reply] : OPen it in notepad, then copy and paste it into your IDE. (by Zaita)
Accessing an array through function
 
Hello, I have this code
[1 reply] : you're passing value by value...that sounds wierd, let me explain. The... (by quirkyusername)
by tonnot
How to write explicitily \n or \r\n to file
 
I want to have the option to write ascii files using \n or \r\n depending the destiny. If I use ofstream.write("\n",1) I get the same result as ofstream.writ...
[4 replies] Last: I am always surprised when someone asks how to do a thing and then rej... (by Duthomhas)
Anyone use SDL? (1,2)
 
im having trouble getting a BMP image to load on my screen. Im following Lazyfoo.net's tutorial and all i get is a black screen. I put the BMP in the same file ...
[35 replies] Last: I agree SFML is the way to go and it even uses OpenGL so integrating 3... (by Computergeek01)
If Example.exe not running close example2.exe
 
Before you respond beware that i am very noob at c++ and was hoping for some help on a very small work im working on. What this code do is basicly starting a ....
[11 replies] Last: I don't know if I can help you with this one. Sorry (by Computergeek01)
Search within a stringk
 
okkk
[11 replies] Last: #include <iostream> #include <string> #include <algorithm> usi... (by Zaita)
by rekson
How do you display exponents in C++?
 
I don't want to do the exponent math per say, I just want to display something like 3x to the second power. All I have at the moment is: cout << coefficient...
[1 reply] : Right now you're printing a number 'coefficient' and a string "x". Sin... (by hamsterman)
by MNM
how to if (int != char) ???
 
Hello ppl! I'm write a simple arithmetic program using functions. The program should SUM two numbers, before that the if statement have to evaluate if this ent...
[1 reply] : Please put your code in the code tags. 1) You cannot return 2 numbe... (by Zaita)
by tonnot
How to change an element from a LIST
 
I simply want to iterate trought a list and if I discover some value at some posittion to change it ,How ? I have searched over the net, but I have not view ...
[7 replies] Last: I know that you probably have to do better things than waste the time ... (by tonnot)
by fasih
My Frist Program
 
#include <iostream.h> main() { int a,b; cout<<"Frist Number:"; cin>>a; cout<<"Second Number"; cin>>b; int sum; sum=a+b; cout<<"Result is="<<sum; getc...
[2 replies] Last: That's nice, fasih, but... 1. What's a "Frist" program? 2. As the ... (by packetpirate)
multi-dimensional vectors arrays
 
What's the way of declaring multi-dimension array?
[1 reply] : http://cplusplus.com/forum/articles/7459/ (by moorecm)
by rekson
"Permission Denied" with a simple class test
 
I'm running a simple program in emacs where I test a class (called poly.h) for use in a .cpp file (poly.cpp). My teacher provided us with a makefile for it, so ...
[5 replies] Last: Be a little more constructive. Like ne555 said, object files are not ... (by moorecm)
February 2011 Pages: 1... 1920212223... 43
  Archived months: [jan2011] [mar2011]

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