elad
My Bad ..Thanks for straighting that out..........I learn something everyday around here........;) ....
Is cin.ignore the only way to deal with using cin in conjunction with getline then?
Type: Posts; User: teeyester
elad
My Bad ..Thanks for straighting that out..........I learn something everyday around here........;) ....
Is cin.ignore the only way to deal with using cin in conjunction with getline then?
Getline under the hood
Problems with getline(cin, name);
Since getline does not ignore leading whitespace characters, you should take special care when using it in conjunction with cin >>.
...
#include <iostream.h>}change to just <iostream>
using namespace std; // add what Brian said here..
int main()
{
cout<<"The Compiler Works";
system ("pause"); // add this here, it...
747ken
I buy all my stuff here:
www.tigerdirect.com
About the lowest prices on most any brand you want....
I agree with most of what frenchfry said.......at Tigerdirect I've been able to...
all's well........
Formatted the new disk...........installed XP..........
put the old disk on IDE #2 and copied all my stuff to the new disk.
Yeah ! everything is right in bios etc...But I think I've found the problem...
On another board I got these replys.......
So as info to all..about XP
Having a problem upgrading my computer....I have bought a bigger hard drive(120GB)...I fdisked, formated(ntfs) and installed WinXP on another computer........when I try to put it in the my...
joshdick & Rog
Thanks for your replys.........
I looked up those keywords and the info on static answered my question. Thanks again.....:D
I'm new to C++ so first programs naturally include a calculator.
My memory question is this:
I have a function for each math procedure(add, sub, mul, div,etc)
I have globally declared double a, b,...
Well yes you could you a switch statement in a while loop, but somebody said they had never seen a for(; ; ) loop used in a real program and someone wanted to see it used so they could...
I've seen this used with looping thru a menu for example
sort of like :
for (; ; ) ...
{
int choice = menu( );
switch(choice)
{
case ( 1...
ok I graciously accept my dose of "Duh am I stupid........
THANKS all........that was it...(cubeSurfscreen)...
:rolleyes:
Full compile log:
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Dev-Cpp\Work\MathW.cpp" -o "C:\Dev-Cpp\Work\MathW.exe" -g3 -O0 -ansi -g3 -I"C:\Dev-Cpp\include\c++" ...
RealityFusion :
OK here's the whole thing so far....As it is it compiles fine
I have the problem area commented out.........
#include <iostream>
#include <cstdlib>
#include <stdio.h>...
This is a snippet from a little calc program I'm working with,
a function to get the surface area of a cube
long cubeSurf (long length, long width, long height)
{
long surf;
long side1 =...
darksaidin :
Touche : :eek: Your right...would have learned more that way ........Teeyester :rolleyes:
Thanks Mr Wizard..........:)
Hey All !
OK the standard format for defining a function:
typeName functionName(parameterList)
{
statements
return value; // value is of type typename
}
Cat
Ahhhh!
cin is an input stream, to read from the stream you use "cin >>". It's legal to say "cin >> *pointer" *IF* pointer points to memory that is previously allocated.
Thank you very...
DougDbug
Thanks for the headsup................:)
JaWIB
Heh ! I'm not too sure either....I'm trying to get a grip on pointers & the code above wouldn't compile....the cin = * pointer didn't seem to fit the format for pointers in the books and...
Thanks Marcos!!
Ugh! saw that my code tags didn't work when I saw the post..:mad:
Ok I got ya...
int *pointer // declares the pointer
cin >>x // reads in the variable
pointer = &x // assigns ...
I'm a beginner trying to get the concept of pointers
Why won't this compile?
[code]
#include <iostream>
#include <stdio.h>
#include <conio.h> /* for getch() */
using namespace std;
int main()...
Ugh!....
Heh Heh !! your avatar says it all :-))
Thanks for your time Teeyester
Hi all,
Trying to figure out some of these errors..Probably going to show how dumb I am again,but this is a simple for loop example and I was just adding system("pause")......and
[code]
#include...