Beginners - January 2009

by dman
Multi compiler pass??
 
I am really stuck with something, it took me a while to work out why but it seems c++ does no passing to gain knowelage of identifiers. eg, this doesnt work:...
[3 replies] Last: You should be fine declaring them in a header as long as you #include ... (by switcher)
Initialize Pointer to Dynamic Array of Struct
 
I am working through Prata's C++ Primer 5th ed. and am stuck. This is a two-part problem. The first bit of code creates an array of struct, initializes the vari...
[3 replies] Last: Thank you Scipio and Zaita. As I suspected, the answers you provide... (by Ganellon)
How to read file data in storage.
 
I am trying to read a config file into a block of storage. How do create a block of storage, like an array of pointers, what would that look like? and how do...
[1 reply] : Just use a vector of strings, so you do not have to manage to size. ... (by firedraco)
by ozan
Constructor return type??
 
Hi, I have a problem with that code given below.This code is simplified version of my source code.Errors are same so I send that format.Compiler gives an...
[2 replies] Last: Thanks a lot mordekai. It worked. (by ozan)
Random Number Assign
 
I know that you can generate random numbers using the "srand ( time(NULL) );" but im curious if there is a way to randomly generate numbers with a cap. For exam...
[4 replies] Last: The probability it draw a new number is twice the probability to draw ... (by mordekai)
I am getting crazy
 
hello first of all, I realy would like to thank you people for this awsome site.. second of all, my problem with c++ lol, it's classes.. very confused on how...
[8 replies] Last: you people are simply GENIUS thanx alot for the help I will be back ... (by DjWilly)
by wawa2
Allegro problem
 
Here's the problem... I only want to move the box.. However, the box always lost, when the circle is trying to push the box.... Is there any problem here?? ...
[4 replies] Last: I had a quick skim over your code if you ever come back lol - you need... (by Mythios)
Relative to Inputing Answers to a Question
 
When enetering in the code for a question I have found my self entering in a question that requires more than 4 or 5 characters, I need more characters so that ...
[4 replies] Last: It helps you by reading someone else code to see how it was done :) (by Mythios)
by nevero
Constructor
 
Hello, I'm new to programming with class and I'm having some difficulties with the constructor. I have created this class class A { public: A(); /...
[5 replies] Last: Ok !! I didn't know that. That actually help a lot. Thanks ! (by nevero)
Program doesnt outputs immediately
 
This is my program, it should, at least I think so, output every char in the every repeat of the loop, but it doesn't. It outputs all of them at the end of the ...
[1 reply] : ok, I found out that cout is buffered and used a manipulator called f... (by closed account 42hU7k9E)
by Peyton
Simple calculator
 
Hi there, I wrote this code for a simple calculator, but am sure that it is inefficient. Is there any other better way of causing it to loop back after the d...
[6 replies] Last: Sigh... x is a reference to the first parameter that was passed to ... (by helios)
by Peyton
While loop conditions
 
Hi there, I have been trying to add two conditions to a while loop - please see my code below, for a simple program which adds 2 numbers between 1 and 20. ...
[3 replies] Last: No problem :) (by Mythios)
by talwar
problem with "cout" (solved by Duoas & Ganellon)
 
i want to be able to create a program where cin is an 8 digit integer and cout is that same integer with two spaces between every digit pseudocode is in...
[8 replies] Last: Your If and else need {} if() { //do this } else { //th... (by Mythios)
vector issue
 
Using devc++ 4.9.9.2 to compile the following constructor. There are no compile errors, however the code produces a seg fault at the resize command which is ...
[7 replies] Last: "mea maxima culpa" helios you are correct. here was the proble... (by caliope)
return??
 
Hello, I'm confused about what exactly returning an integer is for and what it can do if it is not a zero, I understand that when a program reaches "return 0;" ...
[3 replies] Last: thank you very much, now it's making a bit more sense, I'm actually tr... (by hardstylurr)
Friend Function Confusion.
 
I am not fully sure on the way that friend functions work and need help fixing/understanding the friend function "printNumbers" in my code. Header File: c...
[4 replies] Last: No worries :) (by Zaita)
by Sathed
"And that's why he shot his computer"
 
Okay... I'm going crazy here... Here is my code: Salaried::Salaried(double _weeklySalary, int _num, string _name, string _address, string _phNum, stri...
[3 replies] Last: no worries :) (by Zaita)
by meera
explain outpt
 
void main() { int a=10; cout<<++a<<a; } the above code gives the output as 20, 10. please explain
[12 replies] Last: behavior undefined -> illegal in my book. (by anders43)
While loop repeats infinitely, vector doesn't change value
 
Think this goes in the beginners section... 3 days worth of coding experience spread over a few months... anyway: I've been mucking with this code for the past ...
[3 replies] Last: Yeah, that fixed the issue, thanks alot! (by MDevonB)
Function always evaluating true?
 
This code is supposed to return the address of Dummy. However when I compiled it a messge saying the function will always return true showed up. I don't see w...
[8 replies] Last: Like JSmith said - the compiler is choosing what it believes to be ... (by guestgulkan)
January 2009 Pages: 123... 16
  Archived months: [dec2008] [feb2009]

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