General C++ Programming - February 2011 (Page 8)

Problems erasing 2d vectors
 
I have a 2d vector that I am using to store a variable amount of coordinates. I originally wanted to do a 1d vector that contained a 2-element array, but I coul...
[2 replies] Last: Thank you! (by zanielyene)
by Budlee
NO_ob question on which project
 
Hey, I've been coding for a little while using the console and I was wondering I want to write a project with images and movement and wanted to know how to p...
[1 reply] : Try this: http://www.xoax.net/comp/cpp/opengl/ (by PanGalactic)
by Bezi
why type casting doesn't work in here?
 
I know there is some problem with the type casting in here but I don't know what exactly is wrong. #define IMG_I (std::complex<double>(0, 1)) #define PI 3...
[2 replies] Last: Thanks Mercurialol, But this does not exactly answer my question. I... (by Bezi)
Void Game Situations?
 
Hey guys, so im making a game in console and i wanna know if using voids its the best option for making different game situations. Example: Im making a ...
[2 replies] Last: kk thanks (by vitinho444)
by hannes
bind string to function
 
I'm making a program where the user can input a string and the result is shows. For example: If the user inputs cos(0) then the output is 1 There are ...
[4 replies] Last: Ok. Computing "cos(0)+1" isn't a problem really. I have two algorithms... (by hannes)
File I/O errors when running .exe
 
So, I wrote a C++ program in Visual studio 2010 in the form of a dice gambling game. Everything about the game works fine, however I wanted a way to store the h...
[2 replies] Last: Thanks, I wrote the program so that it would create the file highscore... (by TommyJohn)
What I Have So Far
 
Alright, my first game project is making a text adventure game. I've got the rooms linked so far. I haven't seen anyone else linking their rooms like this and...
[6 replies] Last: in fact, it's almost identical to how I format my code That makes you... (by hamsterman)
First VC++ 9 (2008) Project
 
I made an app in C++.net 9 (2008) as my first project. All it does is scan for prime numbers from up to a specific range: // random0.cpp : Defines the entry ...
[no replies]
Memory Allocation Problem.
 
Hey all. void lap::Matrix::allocMemory(){ std::cout << "allocating..."; try{ matArray = new double[numRows*numCols]; } c...
[9 replies] Last: Ok solved the bad_alloc problem. I was passing a pointer to an array w... (by NickPaul)
what's lacking in this code?..
 
the problem is : to make this a diamond. and use only 1 printf("*");. here is the code : #include<stdio.h> #include<conio.h> main() { ...
[4 replies] Last: You're not printing any spaces - how do you expect it to form a diamon... (by PiMaster)
000
 
-00
[1 reply] : Why did you double-post this? (by Zhuge)
switch and fractions
 
hi guys, i need help adding subtracting multiplying and dividing fractions that the user enters into a code. here is what i have so far, but when i run it, the...
[2 replies] Last: if you want to operate on a number of fractions in a continuous manner... (by buffbill)
operator overloading and static functions
 
Hi All, It is important that overloading of = is defined for non static functions only. This has something to do with lvalues. Q1. can someone please ...
[7 replies] Last: I just looked online for some shape class features. I initially coul... (by navderm)
Struct array to function
 
How would you send an array of struct to a function to get all the structs populated? #include <iostream> using namespace std; struct Enemy{ int...
[2 replies] Last: Ahhh ok that makes sense. Thank you very much I've been stuck on that ... (by lance5057)
String Insert variable argument
 
I'm trying to center a title string on a 80 character wide console. The idea is to have a user input the title, then the system figures out how long the title i...
[3 replies] Last: I actually got this to work, I had a different error going on. (by omnigate)
Difference between char* and char
 
What is the difference between variables that are pointers and normal variables? Like what's the difference between char* and char, or void* and void, etc. Than...
[1 reply] : In general, a pointer is just a way to refer to a particular memory ad... (by Zhuge)
If char/string contains a letter
 
Is there something that checks if a character or string has a specific letter inside it? For example : char x; cout << "Type a word." << endl; cin >> x;...
[1 reply] : You can use the find_first_of() string member function. http://ww... (by omnigate)
class and strings
 
i need to create a class: simpleAddress that has public functions to delete, search and list street addresses. a user needs to store the street address as ...
[1 reply] : homework, eh? (by hamsterman)
Question including multiple header files and .cpp files
 
I have created a text based battle simulation in visual studios 2010 and am having a large amount of trouble turning it into multiple header and .cpp files. My...
[2 replies] Last: Thank you Athar! At first what you said didn't make sense, but it push... (by ImpulseChimp)
Class Access In D
 
In D, I created a class called MyClass with a sub-class called Data . In main, I created an instance of MyClass . There're two problems with my code: 1) Can...
[5 replies] Last: I think that you never create a instance of Data, you just declare t... (by closed account zb0S216C)
February 2011 Pages: 1... 678910... 25
  Archived months: [jan2011] [mar2011]

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