Beginners - October 2009 (Page 6)

for loop
 
I need to write a program that asks for an integer and a character and prints out that many characters with only 10 per column. I can't get mine to work. int m...
[13 replies] Last: Thanks a lot it works now! (by Nut420x)
Problem deleting pointers from list
 
I have "Vertex" class pointers in a list. I want to delete these pointers and free up the memory. I deleted the pointers in the first for loop and set these poi...
[4 replies] Last: ok, now i got it. The pointer does get deleted and the memory is freed... (by schnell)
by laozu
Dynamic Memory
 
Suppose I allocate memory with a statement char* c=new ; and then create a new reference to this storage area by char* x=c; Suppose that later in the progr...
[3 replies] Last: There is a way using boost::shared_ptr<> and boost::weak_ptr<> (www.bo... (by jsmith)
by mo327
"private member" : undeclared identifier
 
Hi! I have made a class in whose private members i have included two arrays which I initialize in the class definition rather than the constructor. However, whe...
[7 replies] Last: you can't initialize members in your class definition. (by hannes)
printing txt file
 
Hi, I have a problem here. I want to print characters of a text file on the console. I open a file using fopen(). But how to print??? and also, the pointer re...
[3 replies] Last: But fread() returns me number of characters read, as an integer??? (by AR Khan)
Do While Loop
 
int x = 20, y = 2; do { x -= x - 2; y += 4; cout << x << " "; }while ( y <= 16); cout << ++x << "" << y << endl; ...
[3 replies] Last: If I explain your code that I get the following code: int x = 20... (by screw)
by sparky
vector, vector iterator and substr
 
Hi. I am trying to access and use the values stored in my vector (v) as the parameters for my substr function by using a vector iterator (I) but it seams like i...
[1 reply] : .at() doesn't take iterator parameters. You just pass it the numbers.... (by firedraco)
by MYST
C++ on Mac?
 
Hi guys! I'm studying in computer science at uni, and have just brought the new macbook. Im curious as to weather you can develop c++ apps on osx? Im gettin...
[7 replies] Last: Thanks a ton, mate. (by enterprize)
by Rachel
string Data Members in Class
 
I'm trying to create a simple class as a homework exercise. The problem I've run into happens when I try to create a private data member of type string. I inc...
[2 replies] Last: It was a foolish mistake, as usual. I was declaring it string some_v... (by Rachel)
Char pointers overload
 
Hello, forum. I've been having problems with the overload of a *char. After some amount of text, it starts to add garbage characters in it. Here's an example...
[3 replies] Last: Thank you kindly for taking your time to post here. I think I don't ha... (by Caio Santana)
How to make MMO Game?
 
I google'd for how to go about building an MMO and of course all I got was garbage. And no, I don't want a pre-built fully-featured gaming engine, even buildin...
[3 replies] Last: As I understand it, a multiplayer game is not entirely unlike an IRC s... (by helios)
by JRevor
Reading files using ifstream?
 
First of all , i want to note I already know how the files work (..at least in PASCAL) . Im trying to read a simple text file, in this format //Comments.....
[2 replies] Last: Thanks a lot, Bazzy, that was the help I needed. (by JRevor)
validation
 
hi, I am just learning C++ ATM, but have programmed in other languages with moderate amounts of success (java, c#). I am trying to validate input (cin) to an...
[8 replies] Last: Oh, I get it now. But I think it would be better if the program tried ... (by helios)
by tiptip
Arrays( I have the code but can you confirm it 100000%)
 
Hello guys, the question is: Generate code to declare an integer array,Int_Var, of size 100 and write a C++ Program to carry out the following steps: a) Ass...
[17 replies] Last: NOW I got it 100% Thanks Bazzy, you were really of great help ans s... (by tiptip)
Tricky While loop problem
 
I have a Quadratic Equation program that recieves input from the user, and I only want the input to be numbers. I have this for my input function: void ge...
[4 replies] Last: Works GREAT! Thanks a million! (by Nick00004)
by DBarzo
How to copy a part of a vector in a raw memory
 
Hi, How can I copy a part of a vector into a memory: long ReadAt(T* pData, long items, long& pos) { ... check vector bound .... for(uint i=0;...
[5 replies] Last: You can use the copy algorithm but it does almost the same thing. It's... (by Bazzy)
Run-Time Check Failure #2 - Stack around the variable '...' was corrupted.
 
Does anyone know what a message like this may mean: Run-Time Check Failure #2 - Stack around the variable 'aaAvatar' was corrupted. It happens every time ...
[2 replies] Last: Paste up some of your code if firedracos way doesn't fix it. (by Mythios)
incorrect passing of a value! C++ rookie
 
Hello to all! This is my first post and I am hoping for some help.... I am trying to get my first mid term done in my first ever C++ course, and I am stuck! ...
[no replies]
How to solve exp
 
What the is the best way to compute the formula down below in C++: e^x = 1 + x/1! + x^2/2! + x^3/3! + .... I just need keynotes from an expert in order to...
[1 reply] : Use a loop. All you need to know for input is how many times you want ... (by Duthomhas)
by triz
Same value for all inputs
 
I'm supposed to write a program for a loan calculator. I know there are other errors in the code (like option 5 and 6 are not set up yet), but I'm trying to fig...
[3 replies] Last: Your bad indentation threw Bazzy off -- the problem is in get_choic... (by Duthomhas)
October 2009 Pages: 1... 45678... 25
  Archived months: [sep2009] [nov2009]

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