Beginners - December 2011 (Page 35)

Path for filename(ofstream)
 
How do I give the path name to the compiler? Here is a portion of the code that I have written: ifstream file; file.open("test.txt"); I have test.txt i...
[6 replies] Last: Put "test.txt" in the same directory as the exe and run the exe from w... (by modoran)
Estimate Pi problems!
 
When I run my program it asks the user for input but doesn't calculate the value! Here is my code: #include<iostream> #include<cmath> using namespace ...
[16 replies] Last: Thank you for the solution oriented post Kyon! (by AARON HENDERSON)
by davi
MinMax AlphaBeta Pruning for TicTacToe
 
Hey there. I don't know how does "MinMax AlphaBeta Pruning for TicTacToe" looks like. Is it like a class? Or a function? Is there any example codes for me ...
[no replies]
Reverse Pyramid of Asterisk
 
does any one know the code for creating this pyramid: (3 spaces) * (2 spaces) ** (1 space) *** (no space) **** it looks like a righ-aligned righ...
[11 replies] Last: Both headers will get you the same functions/types, though cstdlib wil... (by shacktar)
by ravar
arbitrary number of variables without using arrays
 
is there a way were i can create a variable with a variable name and then how would i acess said variable.
[1 reply] : You can use std::map http://www.cplusplus.com/reference/stl/map/ like... (by coder777)
Array to member functions help
 
Hey forum goers, the problem I'm having is that I've made a pointer array to make some monsters then later I'm trying to call a memeber function from a heade...
[1 reply] : myMonsterList is a pointer to a Monster object. Try myMonsterList... (by Moschops)
A little help for a beginner programmer.
 
I am in my last weeks of class and I am working on a program that I have all working except one thing, and for the life of me can not figure it out. We are wor...
[3 replies] Last: I'm guessing the following are strings? : salesIn >> ticketDate >> ti... (by Lynx876)
LNK errors (LNK2019 and LNK1120)
 
Hi, I create a new project with precompiled header here my project Complex.h //Complex class declaration #include "stdafx.h" #ifndef COMPLEX_H #d...
[2 replies] Last: Thanks coder777. It's exactly the problem. I just forget to define the... (by cuoilennaocacban)
Making your output to look like its being typed!
 
Hello! I'm a student at a game programming course in Sweden and I've recently started to begin learning c++ in my spare time. First post here, so please be gent...
[6 replies] Last: Thank you very much. :) You've helped a stumbling newbie! (by Tallrick)
Making and using your own library
 
Hey all, I've been trying for some time now to make my own first library. After going through whatever I could find online I've gotten this far: testlib.h #...
[2 replies] Last: You need 2 projects. The library project you put testlib and the other... (by coder777)
Issue with the Sleeping Barber Problem
 
Hello, I understand the description of the Sleeping Barber problem but with the code below, it seems that the output is not being generated correctly. I bel...
[1 reply] : Yes, it's likely that 'barber' consumes the whole processer time. You ... (by coder777)
by gh24
Quick Question about Scope
 
Hi Guys, Can anybody lead me in the right direction in regards to why my variable i is losing scope in the following code: for (int i = 1; i <= 2*no_of_...
[4 replies] Last: For instance I can compile the code without the aforementioned curly ... (by coder777)
stuck at basics!!!!!!
 
I just started C++ two days ago. I am having a slight problem. When I give the input- 97 Fahrenheit, I get the output as 36 Celsius instead of 36.11, having dec...
[5 replies] Last: Don't think "Fahrenheit" counts as english. (by Gaminic)
Need Help here!!
 
I wrote a program, which takes 10 integers from user, and then counts the prime numbers in it and displays the sum. The problem is that it is taking all odd num...
[12 replies] Last: Yep, now you've got it. (by Gaminic)
Vector Error
 
Okay, so I am to create a program for my OOP class that initializes an unknown number of rectangles by reading lines from a text file that contain an x value, a...
[6 replies] Last: In the constructor you don't initialize the member variables (by Peter87)
Postfix increment.
 
Hello, Due to a recent topic on (un)definedness pre/postfix increment behaviour, I was hoping for a quick check on this: // Check if either t.i or t.j is...
[6 replies] Last: Indeed, that would have been a bug. I'm wondering if it's true thou... (by Gaminic)
by izam88
another elevator simulation problem
 
haii...last time i ask about elevator problem and got the solution...for this time i have another problem regarding the same simulation but just need improvemen...
[6 replies] Last: yahhh...hahaha!!! incredibly daunting!!! it's my senior homework...i j... (by izam88)
by hjdut
overload issue
 
I am trying to learn class design, I tried to run the following code, but the compiler complains the ambiguous call to overloaded function, anyone could help me...
[3 replies] Last: You probably want to use const std::string& as the type. (by Peter87)
by teocl5
Algorithm
 
Hi all, I am trying to build a battleship program. However, I couldnt figure out the right way to run my algorithm to randomly place ships on the grid. Here'...
[2 replies] Last: Hi coder777, thanks for your tip. I will take not of this. (by teocl5)
Problems with game design
 
Alright, so I feel I am doing alright at grasping code. I understand various types of variables, and operators. I have a good understanding of functions, and cl...
[no replies]
December 2011 Pages: 1... 3334353637... 47
  Archived months: [nov2011] [jan2012]

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