General C++ Programming - September 2009 (Page 3)

by lye85
problem: string equal to *str
 
im newbie in c, how do i write a statement (string equal to *str) to let string print "hello"? #include <stdio.h> void main() { char string ; char ...
[6 replies] Last: thx guys, strcpy let my thing done (by lye85)
Including in .cpp files
 
Is this considering "good practice"? Just wondering. I.e.: //something.cpp #include "something.h" #include "somethingelse.h" void something::fo...
[2 replies] Last: Ok, thanks! (by firedraco)
Trying to use iddigit...
 
char studentID ; float iGrade = 0; char LetterGrade; cout << "Enter your 10 digit NUMERICAL student ID:\n"; cin.getline(studentID,11); if (strle...
[4 replies] Last: http://www.cplusplus.com/reference/iostream/istream/getline/ You re... (by Duthomhas)
question about switch
 
void takeClass(int numUnits, char grade); { switch(grade) { case 'A': students.gradePointsEarned = students.gradePointsEarned + (unitsTaken * 4); ...
[7 replies] Last: I think you are confused on how to make/use classes...try reading this... (by firedraco)
How can i bulid this function
 
orderedLinearSearch (ListNode<NODETYPE> &currPtr, ListNode<NODETYPE> &predPtr, bool &found, bool &doneSearching, ...
[1 reply] : It looks like your function is trying to do too much, and it is inappr... (by Duthomhas)
How does std::map zero out complex types?
 
class Complex{ float a,b,c; }; void main(){ map<int,Complex> Test; Complex &Item = Test ; } Item's members are all zeroed out. I thi...
[no replies]
by NGen
.Lib File Information
 
I have a few questions about creating a Lib file: - Do namespaces have any effect on how the functions should be declared in the header? - Do I have to us...
[no replies]
Optimizing code
 
Can someone help optimize my code? It seems kinda long and messy, especially since i tried to make it bug proof. I really wanna learn to make my code run fa...
[no replies]
undeclared identifier
 
So basically i have this class when i try to use it in my function 'convertArabictoRoman' it says that the variable 'thous' is undeclared Looked it over soo...
[2 replies] Last: the thing is that in the 'convertArabictoRoman()' function im not decl... (by davemmg)
increment function
 
Id like state that i am aware that ive posted this code before in another thread but im having a different issue. Im trying to increment certain points by a giv...
[1 reply] : I think you probably want += instead of =+. (by Zhuge)
Strings and Char Arrays
 
I am pretty new to C++, and am having some trouble with Char arrays. Heres my code: #include "stdafx.h" //includes all my headers using namespace std; ...
[4 replies] Last: Since you are using a C++ class, why not just use std :: string ? ... (by Duthomhas)
Constructor initializer list using other variables
 
I would like to be able to initialize variables using other initialized variables. I am unable to workout how to formulate line 29. Any help will be gratefully ...
[4 replies] Last: Many thanks. (by Peter1234)
by umquat
Passing and returning parameters using argc and argv
 
Okay I have a problem you may be able to help with. The situation is this. I've recently been asked to resurrect an old DOS based version of a piece of softwa...
[no replies]
Countdown timer
 
I know there have been other threads on here, but some of them require the use of windows-specific libraries. I'm trying to make a countdown timer, and want...
[no replies]
by Ryborg
MinGW and auto-import (what causes it?)
 
Like so many before me, I have been writing with a small game library. It works fine, but when I link to it during the compilation of a demo game, I get this m...
[no replies]
Pointers
 
Hello, I'm new to C++ and so coming from C# where all the memory is handled for me, I am having some trouble in that arena. void CreateCat() { Cat * ...
[8 replies] Last: You pass by reference* when the object you want to pass won't be modif... (by helios)
New to C++
 
Hi, I am new to C++ so forgive me if I am doing some things ridiculously stupid. I want to create a class with private variables with setters and accesors et...
[4 replies] Last: That wouldn't work. istream::getline returns the istream you provide ... (by JCED)
Histogram with rand() function
 
My project requires me to write a program that generates random numbers, maintain a running total of the numbers into categories (0-20, 21-40, 41-60, 61-80, 81-...
[1 reply] : Check the direction of your relational operators. (by helios)
Display only the 20 most used words[word frequency]
 
by Ong Mark Anthony L.
[16 replies] Last: You don't need to break it. Use some logic (i.e. &&) in your for ... (by turbozedd)
Having problems creating pointers to Time
 
Hello people...why can't I get this program to run...I'm about to lose it...I tried everything...I think?!?...Can someone please help me..... #include <i...
[6 replies] Last: i gave it a though here is what i came up with, while in the loop when... (by luther)
September 2009 Pages: 12345... 14
  Archived months: [aug2009] [oct2009]

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