In my book it said that i can use this
cout.setf(ios::fixed, ios::floatfield);
cout.precision(2);
But what if i want to round it off to the nearest 0.50?
like double Cash = 10.34 will be...
Type: Posts; User: arnis
In my book it said that i can use this
cout.setf(ios::fixed, ios::floatfield);
cout.precision(2);
But what if i want to round it off to the nearest 0.50?
like double Cash = 10.34 will be...
Yes that's the only include i have.
If i comment out the enum bool part. I get one less error.
It's not a windows project so its very strange.
Maybe windows.h is included automatic in the...
Maybe this can be for some help?.
#include <iostream>
float Convert(float);
int main()
{
float TempFer;
Ok im having trouble compiling this. Its exactly what the book has written. I know that this book is out of standard (teach yourself c++ in 21 days).
#include <iostream>
typedef...
thanks. Im going to bed now. will test it tommorow:)
haha. My mistake. Ive corrected that. But i still get this random numbers.
#include <iostream>
#include <stdlib.h>
class Employee//Class called employee
{
int Age;
int YearsOfService;
int Salary;
public:
Employee(): Age(18) ,YearsOfService(1) ,Salary(10000){} //...
oh thanks. thats good to know
Thanks for all the replies. I will analyze this carefully now.
" CornedBee: Why does the function return a float anyway?"
I just thought that would be the best way. Because this numbers usualy...
Ok. I tried some more. This is what i got.
#include <iostream>
#include <stdlib.h>
float sum;
int count = 1;
float myFunc(unsigned short int x, unsigned short int y);
int main()
Ok ive just started learning c++. Acctualy i tried to start for like a year ago but I didnt have enough time to learn it.
Anyway. here is my problem.
"Write a program that asks for a number and a...
.. But its seams to me that you used char instead of int
Char is only characters..
try int a; instead of char a;
im not sure about the math signs though.
Again. Im a newbie ,and your...
Im thinking of learning the basics. and then move on to the advanced stuff.
And thanks for replying..
Any other suggestions??
Hello. I'm a C++ newbie. And i'm going to buy a book.
I was just wondering, what book should i get?
Thanks.
U guys know about any IRC help channel for c++ programmers?
Thanks...
When u say threads do u mean like this?
loop (indeed)
{
function();
{
anotherFunction();
}
Is there a way to make a function run "in the background" ?
like this:
myFunction(); //this will run til the app closes..
AnotherFuntion(); //while myFucntion is still running..
Hope you...
What does the '%' do??
I cant figure out what it does!
Im working on that in this very moment.
Im making this Crappy Textbased RPG game..
But thanks for the help
Thanks alot m8
Thats the problem in your code..
{ //Should not be there
if(input==1)
cout<<"Play on";
else if(input==2)
cout<<"Your game is loading";
else if(input==3)
cout<<"Play...
#include <iostream.h>
int main()
{
int input;
cout<<"1. play game: ";//mabey no two dot's?
cout<<"2. Load game: ";
cout<<"3. play multiplayer: ";
cout<<"4. Exit: ";
cin>>input;
Try to use: else if
Im a newb too. But I think it will work..
Tell me if it works=)
if(input==1)
cout<<"Play on";
else if(input==2)
cout<<"Your game is loading";
How can I print the text like its typed?
Its kinda hard to explain.. (because of my bad english skills)
A
AR
ARN
ARNIS
I've just started with C++ and im interested in learning Game programming in windows.
I've read that this book is good for beginners:
'Tricks of the Windows Game Programming Gurus'
Is this a...