Beginners - October 2009 (Page 12)

new programmer, cin.peek()
 
ok, I am a new programmer with c++. I have been experimenting with cin, and cin.get and now I plan to learn cin.peek(). could someone please give me a little ...
[3 replies] Last: You can't, AFAIK. Streams are queues. You can only look at what's at t... (by helios)
How to make Cout (screen) buffer bigger?
 
Thanks anyone who help me with this :D in advance. As I said in my description, the program generates TwinPrimes, from an initial range to a final range. Th...
[7 replies] Last: Thanks for all your help :D Glad to have you guys, Computer Science ... (by PSPMAN90)
Namespace and regions
 
Is it possible to declare a region of class interface 'using namespace' without making the whole file using that namespace? EX: Class interface contains f...
[4 replies] Last: Thanks for your time! (by AlwaysLearning)
Trying to figure out adding in a sequence.
 
I have a question on some work I have to do, and I'm completely lost. I have to use the while/for structures to create a program that pretty much does the follo...
[3 replies] Last: Thanks, I was hoping it wasn't too complex, as I'm still a beginner lo... (by TheMist)
boolean expression
 
In my assignment, I am required to ask the user a question where they respond (y/n) yes or no. I need to convert 'y' to (boolean) true and ''n' to (boolean) fal...
[5 replies] Last: line 14 should be bb = ( tolower(c) == 'y' ); and line 17 cout << ... (by Bazzy)
Function
 
Trying to create a program that calculates the average of three test scores. I have to have three value-returning functions. My book also says that I will need ...
[2 replies] Last: Thanks. My book does not explain that good and does not provide an exa... (by studentm)
by baross
while loop not working - on invalid letter is entered. thanks
 
#include<iostream> char months (char, char, char, char); using namespace std; int main() { char Season,time,time1,time2,time3; Season =...
[3 replies] Last: You're doing it again. You create a variable withouth initializing it ... (by mcleano)
who can give me some advice about learning c++?
 
hi everyone! i am a beginer in c++,though i have learned c++ for some time.now i know some grammar, can write some short and simple program.but these days i ...
[2 replies] Last: thanks,i think i should do a lot work on the standard library. (by huzhanchi)
Question about strings
 
Ok when I run this it seems to work fine till the input loop goes and repeats. It then skips over asking for the name of the company and goes straight to weight...
[1 reply] : Don't mix cin >> x with getline( cin, s ) . http://www.cplusplus.c... (by Duthomhas)
by JRevor
Array question
 
Why does this not work? How can i do that without doing p = 1; p = 0;? int p ; p = {1,0}; Thanks in advance
[3 replies] Last: Thanks. (also, thanks for the second answer huzhanchi, but the idea wa... (by JRevor)
Windows Programming...
 
I am completely new to Windows Programming..... Plz explain me how does a window application work..... I don't understand one thing in the following code...
[2 replies] Last: hi Harlequin WndProc() is called by system, make the "CALLBACK"go... (by huzhanchi)
Very basic... getting a name capitalized
 
Hello, I'm having an issue with my little program. I've been able to do variations where I can get all letters capitalized, but I can't figure out what to ad...
[6 replies] Last: Here's a little module for you to do that kind of stuff. // string... (by Duthomhas)
by wachtn
function returns
 
Can you point me towards a tutorial on using function returns? Thank you.
[3 replies] Last: Yeah, I wanna know how to use the returned value. Thanks Bazzy, tha... (by wachtn)
Tic Tac Toe!!
 
Hi All, i was making "tictac toe" a famous game. i made it but the following portion of the prog although it works but it does not seems good to me. i won...
[1 reply] : Use loops. The only special cases you need to check are the two diagon... (by Duthomhas)
Recognising WM_CHAR messages
 
Hey guys, I need to be able to detect input from the keyboard, specifically numbers. I know I have to use WM_CHAR, with switch WParam, but i'm not sure how ...
[no replies]
by m1st1c
Nested loop output problem
 
Im using nested loops to write a program that will calculate the average GPA for all 3 classes and then have it display. I dont quite understand the output but ...
[1 reply] : P.S. Forgot this information....Calculate the GPA for each class and d... (by m1st1c)
by ab8880
Simple fstreams problem
 
Hello All, I am a noob in c++ and i was trying to code a program where i can get some data from a input file and then create an out put file. My input file lo...
[5 replies] Last: while (!infile.eof()) { int x,y,z; infile >> x >> y; // get a l... (by ab8880)
by meesa
Working with floats, adding precision (1,2)
 
Here's my code float a=1.23456; float b=a; char ch =""; int i; int count=0; int precision=1; do{ if(b<1){ b*=10; precision--; } //For 0.### n...
[23 replies] Last: That's correct. According to the "laws of math" for rounding, you star... (by meesa)
by zsukal
How to convert string to char* and use function(char* text)
 
Hello. I have problem. Program works with code: string nameF = ""; cin >> nameF; char* nameFC = (char*)malloc( sizeof( char ) *(nameF.length() +1) )...
[4 replies] Last: C4996 can always be safely ignored. #pragma warning(disable:4996) ... (by helios)
October 2009 Pages: 1... 1011121314... 25
  Archived months: [sep2009] [nov2009]

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