Beginners - July 2010 (Page 20)

Keep asking for user input.
 
Hey there. I'm designing a program that will ask the user for an ice cream flavor, a sauce flavor, and whether or not they want sprinkles. I am having two prob...
[6 replies] Last: Figured it out, had to set up some restraints. For example: if ((s... (by xcrossmyheartx)
by Erain
cstr
 
Hi all, I'm new to C++ and working my way through an SDL tutorial. One thing that wasn't explained well relates to the following function, which is used to l...
[3 replies] Last: strings are more complicated than they seem. The string class takes... (by Disch)
Equivalent of Java static class in C++???
 
Hello I am quite fluent in java but am currently having issues switching over to c++. In Java I could have something like class myClass{ ..... ...
[2 replies] Last: So a nested public class in c++ is Java's answer to a static class? ... (by yklintux)
Trouble with Tic-Tac-Toe
 
Hi everyone I'm writing a tic-tac-toe program for a programing course that I'm enrolled in and everything has been smooth sailing so far except one lil thing...
[1 reply] : see http://www.cplusplus.com/forum/beginner/1988/ (by hamsterman)
by Marek
Question about "IF" and "return"
 
So my first question is about IF function int number; cin>>number; if (number>99999){ cout<<"Your number has more than 5 digits"<<endl; return number;}...
[9 replies] Last: Ty... all.. i completed... the program... (by Marek)
by human
Array index
 
Hi my fellow members. I am having trouble outputting the index of the largest number.Ive gotten to this point but, now I'm stuck. Any help is greatly appreciate...
[2 replies] Last: That is not going to work if you only pass negative numbers. I'd just ... (by filipe)
Need advice for creating a program to practice spelling words.
 
Im a college student who has just took an introduction class on C++ programming in the spring and I'm tring to write a program in between semesters to keep my m...
[1 reply] : For your purposes, either will work just fine. Reading everything int... (by jsmith)
by human
Vector array not working
 
Hi guys, im having trouble with my code. Im trying to search within the vector for the int checker. The error Im getting is error C3892: 'iter' : you cannot a...
[2 replies] Last: thanks for your help! I needed to use the equality operator, also chan... (by human)
by xyzt
How to determine key members of a class
 
Hello I have a question about class design, which is not clear for me. When we write a class there are many members in that class. What is the best way to dec...
[1 reply] : There's no answer to this question. It all depends on what the type is... (by helios)
by tianj
Error parsing commandline arguments
 
Hi guys, This is my first time writing a program that takes arguments. I have read a couple articles on how to get and parse the argument, including one on thi...
[2 replies] Last: All done. Thanks Athar! (by tianj)
by zaph
using ifstream*
 
Hi, Most examples for using ifstream don't use ifstream pointers. I thought this would not be a problem but I cannot seem to get my code working. The below g...
[1 reply] : You must open your file in binary mode to use read/write. f.open("... (by m4ster r0shi)
simple question on "const" and "string"
 
I was confused with below code snippet. What is problem with this code? const string a = "!"; const string b = "hello" + "world" + a ; It says "+ c...
[6 replies] Last: Just wondering, why would you ever try to add two string literals. Is... (by Athar)
Can you tell me where my problem is?
 
I'm sure you've all seen it a hundred times - Get a phone number in letters, convert it to numbers, have a hyphen after the third number, and ignore spaces... H...
[5 replies] Last: FYI, tempNum = tempNum + 1; is the same as tempNum += 1; Also, ... (by RyanCaywood)
question about atoi
 
Hi, 1. If the program get some char (as an argument argv ), and I want to use this char, can I do: ch = (char)atoi(argv ); Is this a proper use?
[4 replies] Last: calling atoi with any non-numeric string always returns 0. (by binarybob350)
A pointer function question.. advice is needed.
 
Hi, Lets say I have this prototype for a generic function call: void (*func)(void* element) Can I build a function (that I can call with the above call) ...
[2 replies] Last: What do you mean? I do have a different function pointer in my MAIN... (by retro21)
by b52
Question about parens
 
Are the extra parens in the commented statement superfluous or am I missing something? Compilation and execution appear to be unaffected. Thanks, b52 ...
[4 replies] Last: Look at std::pair. It's made for that kind of stuff (or use reference... (by firedraco)
i cant understand the 5th line of this program :D
 
1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <math.h> 4 5 int main(int argc, char *argv ){ 6 FILE *fp; 7 int row, col, ban, hea, half, sum, ...
[5 replies] Last: int main() declares a function of type int named main . This is, ... (by RyanCaywood)
Can we declare enulm with flaot values
 
Hi all i want to know wether we can declare float in enum??? If not can we have alternative for it??? I want to to implement tag-value mechanism in my proje...
[1 reply] : [quote=rohandreamworld]Hi all i want to know wether we can declare flo... (by m4ster r0shi)
by Ditab1
Sorting with Multiple Columns
 
#include <iostream> #include <fstream> // File Input/Output Stream #include<iomanip> #include <windows.h> using namespace std; float sum=0; float a...
[4 replies] Last: Here's a small example: #include <iostream> #include <string> //f... (by m4ster r0shi)
Simple and Quick question.
 
Yeah, I've only got a simple question... If I make a constructor for Class A, and then decide to make a new class B inherit from A, will I have to write a ne...
[4 replies] Last: [quote=AngelHoof]Ah excellent... So, I do that In the Definition of A'... (by Galik)
July 2010 Pages: 1... 1819202122... 31
  Archived months: [jun2010] [aug2010]

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