Beginners - May 2009 (Page 20)

by upo
Strings
 
Hey There, I am actually facing a problem here guys. In an array of strings I want to remove all the punctuation and also convert all the letters to lower case...
[10 replies] Last: 'A' is a numeric literal translated by the compiler at compile time. ... (by Hammurabi)
by Bv202
Generating 3 random numbers
 
Hi, I want to generate 3 random numbers by calling a function which generates a number 3 times. The function is: int randomgetal() { int getal; sra...
[5 replies] Last: Yes. He said '0' means current time This is wrong since it always gi... (by Hammurabi)
inheritence problem g++
 
I have a link list class, and a derived class from that. In the link list, there is a protected node pointer called "first". I need to used first in my derived ...
[4 replies] Last: Sorry, I guess I was too tired last night, because when I tried it aga... (by Gumbercules)
by arshak
opening web-pages
 
Hi. I wanna write a program, that enters a web-site (for example www.yahoo.com). Can u help me and write the code?
[3 replies] Last: it took me 5 mins to find this on google--- #include <iostream> #... (by kyle11778)
Trying to create an array of objects in a class
 
Hi. I'm getting compiler errors in the following code. //deck.h #ifndef __DECK #define __DECK #include "card.h" #include "player.h" #include <strin...
[2 replies] Last: This error occurs because each file includes the other, a potentially ... (by Hammurabi)
SUCCESS...almost
 
so i got my xml changing program to work finally but i had to scrap part of it. now i would like some guidence if any one has the time. i got this program t...
[7 replies] Last: I forgot to put a break; right after mydoc.close(); (within that b... (by Hammurabi)
by murva
pointer to array of objects
 
I declared a pointer to an array of objects and it is sending as an argument to constructor of another class. This argument is being sent without mentioning the...
[3 replies] Last: Thanks!! (by murva)
by Joe101
Recursion int param const issue
 
Hi, I am running the code below but I get the error invalid suffix n on integer constant This error relates to the bolded line below at the first r...
[3 replies] Last: Yeah it happens to us all lol :) am i right in presuming you're a math... (by mcleano)
How to create array of class without default constructor
 
Hi... I am C++ beginner and would like to know how to create array of class without default constructor. Class myClass { public : myClass (int a, int...
[3 replies] Last: Thanks for the answer. Abu (by abuikhlas)
How you change an object from base class to derived class?
 
Hello, I have the following classes class Rock { public: Rock() { goldAmount = rand() % 100 + 1; price = 10; }; int revealContent() { return goldAmount...
[8 replies] Last: Thank you all of you. I also thought of using static_cast but then I... (by cppstudent)
Wrong Compiler?
 
Microsoft has Visual Studio with its own compiler of C++. I learned some C++ using this package. However, when I look through some of the posted questions on ...
[1 reply] : there is a lot of different formats Of what? Of compiler output? That... (by helios)
by Claymz
reversed string: string space problem
 
hi, how can i output users input sentences - with spaces ive tried with strings, but no luck, but i also want to know how to do it with chars: char examp...
[18 replies] Last: you know what, i agree with you completely and ill listen to your advi... (by Claymz)
Quadratic eqaution solver not finish
 
Here is my program, there a error every time i run this program. But it don't stated what error is is. Here is my error list. ------ Build started: Project: w2...
[1 reply] : change d=(pow(b,2))-4(a*c); to d=(pow(b,2))- 4 * (a*c); ... (by kyle11778)
More delete problems
 
A couple weeks ago I posted a problem with "delete", http://cplusplus.com/forum/beginner/10266/ The problem was that I was accessing the array out of the bou...
[9 replies] Last: Alright well it looks like its not a simple enough problem. I will go... (by tkurowski)
How to count words effectively?
 
Hi, I made this small example for counting words, but it doesn't work well when I put two sentences or more spaces between words since the entire counting works...
[10 replies] Last: You could use isalpha, like this: #include<iostream> #include<str... (by Hammurabi)
Print Pyramid?
 
How to print to screen the pyramid : 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321...
[3 replies] Last: When I get home, I have a small class and a couple algorithms that plu... (by closed account S6k9GNh0)
writing code for certain functions..
 
thanks guys it worked. thats was only part1. i still have to.... Erase all leading whitespace from a string Erase all trailing whitespace from a string Era...
[2 replies] Last: Check out this link. http://cplusplus.com/reference/string/getline/ ... (by kempofighter)
Symbols within strings.
 
I can't seem to find any information how to force quotations to be printed as symbols within a string. For example if I have this piece of code: string Line3 ...
[5 replies] Last: The backslash is used for two purposes. First, it gives special m... (by kempofighter)
by murva
const char*
 
Could anybody please explain me the difference between the two following expressions: char *const p1="John"; char const* p2="Mary"; what is constant in...
[4 replies] Last: Thanks, I got it now; very clarifying example (by murva)
May 2009 Pages: 1... 18192021
  Archived months: [apr2009] [jun2009]

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