Beginners - October 2008 (Page 9)

typecasting problem?
 
/* This program will accept the input of two integers, m and n. If m is greater than n they will be used to calculate a Pythagorean triple, by the formu...
[4 replies] Last: If all the variables which you have declared aren't necessarily to be ... (by aakashjohari)
question about the operator ==
 
Hi! I'm new here. Is it possible to use the == operator like this: if (var1 == var2 == var3) { // code here } If not, then is there a simple...
[2 replies] Last: That explained it very clearly. Thanks! (by user name)
about atoi
 
I have the following code: #include "stdafx.h" #include <iostream> using namespace std; void main() { int x = 0; char letter ; cout<<"Push a key:...
[4 replies] Last: misurex, i think you have your if and else case switched... :)... (by cheif)
Replacing a number with a word
 
Writing program to replace numbers divisible by 3 with the word fizz.(Actually trying to setup with a function but could not get that to work) This adds the wo...
[7 replies] Last: const int num = 3; works very similarly to int num = 3; , except th... (by cheif)
Capitalize strings
 
Hello First post here Anyway,this is the first ever C++ class I have taken so forgive me for the questions that may seem so simple. I have to writa a pr...
[3 replies] Last: :p Good luck doing this and have fun watching football ;) (by Scipio)
by tiris
return returns nan
 
Hello, I am quite a beginner, so the answer to my problem might be quite simple, but I cannot find any solution by searching. I wrote a main function, calli...
[2 replies] Last: I am really sorry, but now I compiled the above code anew and it works... (by tiris)
minus function for calculator
 
#include <iostream> #include <conio> int Sum(int, int); int minus(int,int); void main() { int userInput, ansTotal, ansNum=0; bool ans = true; ...
[9 replies] Last: Thanks very much it solve the problem like a charm.In programming fiel... (by low1988)
Triangle, logical and relational operators
 
Basicly, i have to write a program which reads the lenght of all 3 sides of an triangle, and the program finds out if the triangle can be drawn. The basic rule,...
[4 replies] Last: Yes. I always use braces, to avoid mistakes (eg if i add some lines la... (by Scipio)
if else statement
 
I've been trying to make a very simple program for my wife's birthday. it uses a basic if else statement but I cant get it to work right. it's also the first in...
[6 replies] Last: Nah, its not embarrassing. I think all beginners goof up there at firs... (by Cerburos)
not accepting namespace
 
Hi, I'm totally a newbie in C++ programing, I'm starting from de first lesson, creating the "Hello World" program, and had several errors. First, in the line "#...
[4 replies] Last: Thanks a lot everybody. To Bluezor, my answer is yes, I used "using na... (by yaguarete)
confuse with geth() in function prototype
 
i'm confuse either which line should i put the getch() to display the final result properly.When i refer to the book ,it mentioned about using namespace std ...
[1 reply] : Yeah...from what I've heard, Borland seems to not be very good...I wou... (by firedraco)
by Sathed
IF a specific number resides in an integer
 
I have to build a project for an assignment and I've got everything except for one minor snag. I need to build a game called fizz buzz. In short, it needs to ...
[1 reply] : You can use / and %. For example: #include <iostream> #include <s... (by Scipio)
terminating a loop
 
I would like to have the program run otherwise terminate when employee number or 'empnum' is entered as 0. I did some research and couldn't find an answer that ...
[3 replies] Last: Hey thanks guys for the input. I went with Hazer's plan and the projec... (by cascade384)
by Foe89
Outputting multiple values of same variable
 
I'm new to C++ and I'm having trouble understand how to output a "random" multiple valued integer. My program asks to input any number of integers and find the...
[7 replies] Last: how would u do a flowchart to this code u presented in the beginning i... (by imakila)
by Hazer
Rand
 
I'm making blackJack game and i have a problem with geting random number. Function void getcard(){ srand(time(NULL)); card=rand()%10+1; } 'card' was...
[2 replies] Last: Thanks! (by Hazer)
All Possible Arrangements of a word
 
I want to make a program that prints all the possible arrangements of a given word. As Input - abc abc bca cab acb bac cba
[11 replies] Last: yes i have problem with repeated letters. the length of the word may v... (by aakashjohari)
Adding Colour to Text / Resize Console Window
 
Howdy all, Been programming in C++ for a few months now so I'm pretty confident with the basics. Currently playing around with a few text-based games and I'm...
[3 replies] Last: To Move/Resize the console window: MoveWindow(GetConsoleWindow(),x,y... (by Bazzy)
C++ Practice
 
I am trying to write a program that allows the user to select from a menu various types of nuts. After the user enters their choice, the Cost Per Pound is Displ...
[4 replies] Last: Bluezor, your solution worked. Thanks again. (by benjacl)
by JGD
Echoing, I/O, code review...
 
Hello, I am very new to C++. I would appreciate help in opening, reading, and displaying a file. Here is my code so far:#include <iostream> #include <stri...
[1 reply] : while (resultsTxt >> number) { count++; cout << setw (8) << name ... (by nrc1982)
FILE STRUCTURE IN fopen
 
hello friends fopen function in c returns a pointer to a structure type FILE.this is defined in stdio.h as typedef struct { char* _ptr; int _cnt; cha...
[1 reply] : here is an interesting read: http://tigcc.ticalc.org/doc/stdio.html... (by guestgulkan)
October 2008 Pages: 1... 7891011... 20
  Archived months: [sep2008] [nov2008]

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