hi, really annoying me now, it compiles, runs, and the add or mult work with the response part, but when it says enter the 2 numbers to either add or mult, when i hit enter it does nothing, just goes...
Type: Posts; User: psycho88
hi, really annoying me now, it compiles, runs, and the add or mult work with the response part, but when it says enter the 2 numbers to either add or mult, when i hit enter it does nothing, just goes...
what i want is like..
top of the program says HP or Health = 100...
whenever i get hit, the health goes down depending on how hard u get hit but i dont wait it to print somewhere else...
...
one where you enter a name, then last name and then age and it stores it. or you can look some up.
and even when uve closed it, if u re open the program u can search for what u entered.
?
ok ill try a database program, any chance youv got a small piece of code from one that i can check out? :-D or the tutorials for them?
im trying to make a fighting game where u take in turns to do stuff..
if i make it...
int health = 100;
int ohealth = 100;
how do i get it to show the health all the way through the fight?...
hi, im new to programming, just wondering if making a fighting game, in dos mode, where u take in turns to do stuff, like a text game?
like
both start with 100% health bar [...
bah, fixed it.
this works perfect.
#include <stdio.h>
#include <string.h>
int main()
ok thanks for the tip. yeh i tried putting the age *= 7 at the top and bottom, middle everything and it wouldnt work for them both lol, didnt think of doing the
printf( "your "%s" is "%d" is %s"...
I got the idea from a source in the projects part of website so thought id try it on my own.
#include <stdio.h>
#include <string.h>
int main()
{
int age;
geez it still wont work. if i type in the age part, 60 it gives
your age is 2293612
whats the problem cuz the code looks good to me.. then again im a n00b.
oh yeh i see sorry. i had the &name but i took it out because name didnt use one, didnt know arrays didnt need one. sorry.
thankyou.
sorry for posting that many ill cut down heh.
but it is different as it doesnt work... ?
the scanf( "%d" , age ); is right isnt it?
if ( age == 17 ) {
printf ( "im that age too\n" ); }
...
thanks for the help sunny n sly in the last post but salem locked it so i have to make a new one for the other problem... :/
it works, but how to i get it to tell them what age they r if its not...
thanks it works now.
but when i type something other than Reece, how do i get it to say, your name is "....." and same with age ?
+ when it says enter your name the thing u type starts right at...
also it says...
C:\Documents and Settings\Reece\My Documents\Untitled1.cpp In function `int main()':
12 C:\Documents and Settings\Reece\My Documents\Untitled1.cpp `reece' undeclared (first...
#include <stdio.h>
int main()
{
int age;
int name;
printf( "enter your name" );
#include <stdio.h>
int main()
{
int age;
int name;
printf( "enter your name" );
done it, geez the results a bit... ummm... you know.
i thought of adding getchar(); but wasnt sure, also i didnt see you say it lol.
thanks.
reece.
after 12, it just quits.
i thought return keeps it open...
it works not, but it dont say table of monthly rainfall.
it says enter this months, then last months... then assume this month is last month.. keeps repeating....
yeh, it compiles but no run...
even in my docs, where i save it, there isnt an ex, its just a source file... how do i run it?
reece.
still nothing.
in Dev C++... i click NEW, PRJECT.. shall i choose WINDOWS APPLICATION or something else?
i compile fine, run... nothing happens, even if i click the ex in folder. :(
cheers mate, dint make sense at first lol.
btw, how do u get it to run, this code compiles but dont run, nothing will run that i do so i try a code thats been used by ppl n it still dont run.. ne...
hi, whenever i do a tutorial, or even my tiny lil codes it wont run...
i even copied a code out of the post about help clean this up, it compiles but dont run.
annoying me really bad because...
sorry if this post is old and dead, but whats %lf mean ? ive had %d and %s but not %lf.
sorry but it confused me, i understand the rest of the code.