Beginners - November 2009 (Page 24)

by sparky
Validating int and char using enum?
 
Hi, I am trying to validate whether a user did not input one of the following 4 characters: a,b, 1 and 2, and was wondering if I can use an enum type to accomp...
[10 replies] Last: Jsmith, Your right, Duoas code works like a charm! (by sparky)
by rej3kt
arrays within an if statement
 
Getting a bit stuck trying to put an if statement to test weather the array value entered is bigger or equal to 1 and smaller than or equal to ten. I've tried ...
[6 replies] Last: for (counter = 1; counter <= 9; counter++) { std::cout << "Ente... (by kbw)
[ASK] C++ about friend function
 
Hello senior2, I'm still dummy in C++. There are something that i want to ask. There is a little program my lecturer gave. #include <iostream.h> #include <...
[1 reply] : In other words, you know nothing about the problem since you've marked... (by jsmith)
Class date
 
This is my code(distance date 1&date2). I don't understand well using class and operator. So please help me! #include<iostream.h> #include<conio.h> class...
[2 replies] Last: Thanks screw! I couldn't find the information about this! (by chinzoo)
why are friends used?
 
in overloading operators when set and get can be used in its place other than for performance reasons?
[5 replies] Last: Providing a get/set methods for a class is usually a bad idea: http... (by Abramus)
Setw() out files, while(!inFile.eof()) repeats final term
 
I'm trying to collect some data point from a file and display and perform various calculations with them. I suppose it would help if I knew the correct way to g...
[3 replies] Last: Alright so I got setw() working for the cout commands but when I expor... (by Programmer Will)
Guessing game. 1-1,000 but only loops twice?
 
I am having trouble getting this code to run. It's impossible to guess the number correctly as it only loops twice. #include <iostream> #include <cstdlib>...
[3 replies] Last: also you do not need your answer variable (by Aazor)
Cannot Understand Compile error
 
SOCKET s; bool ConnectToHost(int PortNo, char* IPAddress); void CloseConnection(); char ip = "192.168.1.104"; char* ip_ptr; ip_ptr= &ip ; //bool con...
[2 replies] Last: Now that you know that the global (white space) is really there for v... (by guestgulkan)
by Regine
program that displays pyramid of asterisks
 
#include<iostream> #include<conio.h> using namespace std; int main() { int rows, cols, numOfAster; cout << "Enter the level of of the asterisks:"; ci...
[4 replies] Last: ah, the mystery of the pyramids! examine the evidence! each level is ... (by herbert1910)
3d or multi-dimensional arrays
 
Well...This is the question that has been bugging me for a while. I have done a whole bunch of researches on this topic, but my effort is just in vain. I find n...
[10 replies] Last: Thanks a lot for helping and clarifying that. It is much better now. (by kenryuakuma)
Reading floats and integers from files
 
In my programming class we just began using files and our first assignment deals with reading and integer from a file giving us the number of a triangle then re...
[2 replies] Last: Alright, no parenthesis. Thank you for that one. I think I found the s... (by Programmer Will)
by ripley
type word
 
hello, i am very new to c++. and i am having problem like this: i definied a new type typedef unsigned short int word word k = {0xaaaa, 0xbbbb, 0...
[2 replies] Last: thank you :) (by ripley)
Won't compile, can't figure out why
 
I have this code I'm trying to convert a string to a float, I tried to compile it and got error message: syntax error at end of input I can't figure out w...
[3 replies] Last: Ah HA! I had a feeling it was a problem with the braces, just couldn't... (by tl1000s)
Array
 
Trying to complete a program that displays number of days in a month using an array. Need to display the number of days in the month corresponding to the number...
[5 replies] Last: that was it thanks all. (by studentm)
Issue dereferencing iterator
 
I am getting a debug assertion when running playBall. expression: list iterator not dereferenceable. The getTeam function recognizes the teams I want it to f...
[1 reply] : Ok I fixed the above issue. Thanks again! (by Afupi81)
Function Crisis!
 
hey everyone im new to this site so forgive any wrong-doing. Heres my problem, in my class we have just started learning about functions, so for an assignment I...
[2 replies] Last: thanks for the quick response i just had a DUH moment reading that... (by atticusr5)
by destro
Guessing game loop problems
 
I've been working on this game to guess the secret word, but i've had more problems than success. I'm rusty on my C++ and never was very fluent and I can't figu...
[7 replies] Last: Thanks bunches. (by destro)
why is the copy constructor called twice?
 
In my Date class I added a static integer that keeps track of the # of objects created, but the count is incorrect and it begins when I call my post-fix increme...
[2 replies] Last: It is because you are not returning 'temp' itself, you are returning a... (by firedraco)
by DCC1
Sort algorithm for integers
 
Hello, I wrote a simple sorting algorithm that sorts an array of integers into increasing order. The sort algorithm is: void sort( int list , int length ) {...
[2 replies] Last: Thanks for the reply. It appears I have solved both issues - after ste... (by DCC1)
converting string to integer program problems (1,2)
 
I'm trying to make a suite of 4 functions one of which will take a string containing a valid integer number and converts that number into an integer. The profes...
[20 replies] Last: Yea it all makes a bit more sence, thank you everyone. (by tl1000s)
November 2009 Pages: 1... 22232425
  Archived months: [oct2009] [dec2009]

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