Beginners - September 2011 (Page 22)

If and Else Statements
 
Hello, I am new to C++ programming and I am having trouble writing if and else statements. Can someone give me an example of how if and else statements a...
[3 replies] Last: The else part is optional by the way. (by hanst99)
by bpx95
String Acts Unexpectedly
 
Here is my code: #include <cstdio> struct A { const char *name; void setName (const char *n) { name = n; } }; void Assign (A *a) { cha...
[3 replies] Last: There is no real GC in C++, but you're close enough. Glad it works for... (by hanst99)
Rand result equals an object
 
I'm trying to re-create the 'opening of a chest' to find a random item inside (which itself is an object of a class). In this example, I would have my rand f...
[9 replies] Last: Sorry I didn't respond right away, family outing this weekend. Don'... (by Computergeek01)
by Seeshi
GCD problem
 
I really don't need help with the gcd formula. I have that down, but I keep getting strange errors that I don't know how to fix. Here is my code. #include...
[4 replies] Last: Ah! Thank you! I totally forgot about the whole = and == thing. I feel... (by Seeshi)
A problem about calendar
 
Based on Jan.1st,2000 00:00:00,you can enter a number(means the seconds) to calculate any date of recent years.For example:When you enter"-1",it outputs Dec...
[2 replies] Last: Thanks for your answer.Maybe I should devide the seconds into several ... (by brayciano)
const operators
 
Hi everybody, Itried to search both this website and the internet regarding the following topic, but I haven't found anything...could you provide me some deta...
[4 replies] Last: Many thanks, and apologies for my mistake. (by araculsa)
by Toctep
undefined reference to class constructor
 
Hello, i have wrote some code main.cpp #include <iostream> #include "class.h" int main() { line *ptr = new line(1.0,1.0,1.0,1.0); ptr->showData();...
[9 replies] Last: thx (by Toctep)
First HW in C++, please help
 
I have not written too much yet, but my program keep facing syntax error during rebuild.I don't understand why the error would come out. Could anyone please hel...
[3 replies] Last: The } is needed at the very end of the file. There are things in most ... (by hamsterman)
Methods
 
I am working on an assigment for school, and I not getting how to do methods, I am to write a printFruit method that takes in 0 arguments, and simply prints out...
[4 replies] Last: [quote=Shirako]I got nothing out of Your statement...I Started program... (by closed account zb0S216C)
by ozair
Some questions
 
I don't understand the concept of libraries and dll files.... for example, I was trying to use Opengl GLUT 3.7.6, I download the files needed to get started ...
[3 replies] Last: The libraries contain compiled code. If you were given a source code d... (by hanst99)
by xdega
Problem comparing strings!
 
I am working on a program that uses conditionals and user input in the form of strings. The problem is that my program doesn't appear to be comparing the string...
[11 replies] Last: Your previous program wasn't that wrong, you should have just keeped t... (by hanst99)
clearing the screen
 
{ int max, death; string black = "/roll"; { cout<< " Welcome to the dice rolling game\n"; cout<< "\n"; cout<< "To roll the dice s...
[7 replies] Last: Awesome stuff guys. /* All credits for this goes to Duoas @http://www... (by closed account 10oTURfi)
Homework help
 
I'm in the middle of a distance learning class for C++ and as such, the professor chose a rather crappy textbook to have us learn out of. #include <iostream>...
[17 replies] Last: This does not return two values: return balance, totalServCharge; ... (by shacktar)
by vlad61
Arrays and strings
 
Hey guys im trying to create an array of strings. is that allowed? If not what should i use instead? string female_name = {"Martha","Jude","Abigail","Maria",...
[no replies]
by erikn
New member, learning C++ from books
 
Hi all. Complete newb here. Learning C++ from a couple library books: Using C++ (Rob McGregor, QUE) and C++ A Beginner's Guide (Herbert Schildt, McGrawhill/Os...
[1 reply] : I guess I'm having semantic issues with the phrasing of the challenge... (by hamsterman)
setting one variable to match another
 
How do I set one variable to match another, without changing the first? Example, the user inputs 2, and I want to use that input to set another variable to m...
[3 replies] Last: Thank you Disch, that is what I thought, but I was trying to overthink... (by Smooth23)
Member Function of an Object Being Pointed to
 
I have a string which I'm passing to a function by using a pointer, so that I can modify the string from within the function. Now, the problem I'm encountering ...
[2 replies] Last: Find_String($Str,) What is this? Oo A typo. I'm not actually using a... (by Cjsheaf)
Pointers syntax - check my logic
 
Hi! I'm relearning pointers, and I wrote the following code to test out some syntax. Please comment on my comments, and add further explanation when necessary. ...
[1 reply] : [quote=benghaner1]why does 'divisors ' give a value and not '*divisor... (by closed account zb0S216C)
need help with binary
 
ilog2 - return floor(log base 2 of x), where x > 0 Example: ilog2(16) = 4 Legal ops: ! ~ & ^ | + << >> int ilog2(int x) { int hold; ...
[1 reply] : After consulting with my psychic abilities, I can conclude that I have... (by closed account zb0S216C)
Statistics:Mode (Inheritance)
 
I have been working on this program all day and I can't get this program to run. After I fix an error I just keep getting new errors. I am trying to call get_Me...
[8 replies] Last: Do I define Mode() in the Statistics class and how would that look lik... (by karatekid)
September 2011 Pages: 1... 2021222324... 48
  Archived months: [aug2011] [oct2011]

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