Beginners - June 2010 (Page 10)

Expected primary expression before '{' token
 
Hello... Just started out and am trying to explore the various features of c++ by writing a small program. In xcode I got the errors: Expected primary exp...
[4 replies] Last: OK... thanks a lot helios... you've been a great help. (by Yoshima)
by ozair
reading whitespaces in input
 
I am using 'string' header in program, the problem is that the function cin.getline() uses char* as its first argument rathar than a string class object... I al...
[7 replies] Last: arghhh, I didnt asked for what is necessary or what is unnecessary in... (by mcleano)
finding most commonly used word in txt file
 
Ok so I need to find one word for each letter [a..z] which is the most commonly used for that letter. I thought of creating an array of linked lists, where word...
[5 replies] Last: Ok I got this, thanks. Could you please take a look at my code and tel... (by player09)
by EEmsu
counting characters in a string
 
Hello, I am new to c++. I have been trying to write a program that counts the total number of characters in a string. The program then outputs the total of let...
[6 replies] Last: Thanks for all the help. (by EEmsu)
by dasman
Mechanics of C++
 
Hi I just wanted a good reference which describes the various terminology like compile time, linking, assembler, runtime etc. I can write programs in C++ and ca...
[1 reply] : The Wikipedia articles are very good about explaining how all that wor... (by Albatross)
What is wrong with this assignment
 
Hi I just got feedback from my teacher and he gave a comment for the following piece of code: void IOclass::printDice( vector<Die> diceVec) { int...
[6 replies] Last: Arrays can contain whatever type you want. A vector is usually the be... (by SirSkorpan)
Incredibly frustrating. Can't run simple Hello World project
 
I've copied and pasted a simple Hello World "program", however it will not run, due to some error(s) apparently associated with the line "#include <iostream>". ...
[9 replies] Last: Dev-C++ does have a few quirks that are annoying. To be honest, I ha... (by Bo Pace)
by xyzt
defining iterator in a template class
 
I couldn't find a reasonable title for the question, sorry. I try to wrap a map container to make it thread-safe. I wrote the below class but i get compile err...
[8 replies] Last: Was that just a typo or a freudian slip? :) I have to admit, it was... (by R0mai)
How to make the line to be constant? use wat code??
 
my output for my assignment was : My problem is wat code sholud i put so that tat whole vetical line would not move? becuz if i enter in a digit for example ba...
[4 replies] Last: Detail! But to be fair to Grey Wolf, I edited it. -Albatross (by Albatross)
Looking for a good way to populate a vector<Object*>
 
Hi, As the title says I'm putting pointers to objects in a vector. The way I'm doing it right now is like follows: (object 1, 2 and 3 are all derived from th...
[7 replies] Last: That is a good way of thinking about it, I feel. (Still probably need ... (by SirSkorpan)
Decimal Rounding (Round Up only) (If statement)
 
Hello all, I need a little help. I am making a program that needs to do these things: I have a number gallons if gallons = 3.08743 gallons now needs ...
[5 replies] Last: ok, i will try and see 1st.. (by cptntan)
using cygnus and mingw
 
i have downloaded the complete packages of cygnus and mingw. but I dont know how to compile and run programs by them
[1 reply] : how to do settings in eclipse for developing c++ programs . I have do... (by manish411)
string array returning erros
 
for some reason the following code returns error "a function-definition is not allowed here before '{' token" all the time, cannot seem to figure out why, sor...
[7 replies] Last: I think you most likely meant this: for(i = 0; i < 20; i++) { ... (by Galik)
by siue21
Finding divisors and adding number of divisors.
 
I have to write a program by tonight and i am stuck on one particular part. My code has to have two numbers entered and then list the divisors of the first and...
[4 replies] Last: you may use functions to calculate divisors instead of writing similar... (by anushka)
by AJL
Comparing date with system date
 
I'd like to know how can I enter a date so it can be compared with system date and how can I compare them?
[no replies]
by gdsimz
Issue inheriting from a base template class
 
Hi all, I have a template class (assembled as a double linked list requirement) which looks like an array with subscript operators, etc. I have the class re...
[2 replies] Last: If you really want to use INDEX as index type, use: typedef INDEX in... (by magnificence7)
by dasman
Char *
 
Hi, I was just wondering about this, Char * s = "aaaaa" is valid, it creates a pointer to char and also points to "aaaaa". But why doesn't int * p = 45 wo...
[1 reply] : Because "aaaaa" is a pointer to a block of memory that contains aaaaa.... (by Albatross)
Trouble with strings
 
I had to input temperatures into numbered weather stations. This time I need to address name's to each station, then input temperatures from each station. /...
[1 reply] : For starters, check lines 20 and 70. After that, what exactly are y... (by Albatross)
c++ class template instantiation
 
I'm trying to instantiate a class template pointer but unfortunately, vs2010 cannot compile it. The class I'm creating is a resource manager which contains a li...
[7 replies] Last: Ah ok. It works when i put everything into a single file. Thanks for t... (by mjrscrewup)
by EdBoon
new Struct array on free store
 
Hi, I am working on a bit of gaming code and have run into a small problem ( more of a misunderstanding) I am using allegro/c++ but allegro shouldn't come into...
[8 replies] Last: oh yeah that is a smart way to do it, your lesson gave me player.progr... (by EdBoon)
June 2010 Pages: 1... 89101112... 26
  Archived months: [may2010] [jul2010]

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