It's reading the 5.5, but for some reason it's being truncated in the conversion:
int num;
if (sscanf(text,"%d",&num) == 1 && num > 0)
It's reading the 5.5, but for some reason it's being truncated in the conversion:
int num;
if (sscanf(text,"%d",&num) == 1 && num > 0)
How do you know that it is reading only 5? Are you using a debugger or using printf? If you are using printf maybe you are using a wrong format specifier.
Because if I don't use that method and just print out some number it works.
I've used the following specifiers:
%f -- gives 5.000000
%.2g gives 5 ( g is the only one I know how to use to format decimal places)
Uhhh, why does C have to be a pain in the butthole?
Because you're a masochist?
I suggest you shut your big yapper [insert Moderator's profanity edit here]
If it's your school telling you to use that crud, then find a better school because they'll be incapable of teaching you anything useful.
Schools out tard. Java is the only thing taught at my school (when it's actually going on).
I never heard of it, but a simple google search brought me to some robot. Don't know why that will help you learn Java when it's real use isn't relating to robots.
Is there a reason why the fgets is delimiting a '.'? If I enter 5.5 it truncates to 5... How can I get around this?
1) I want to get naked and watch a movie.
2) I love women with big......... boo.. I mean brains.
3) I hate slow drivers.
4) I plan on taking over the world.
5) Remember, server crash is cooler than you.
@server_crash try devshed? But I thought u were already using that. :rolleyes:
I am, but there's specific reasons why I was wanting to compile and run under Miracle C.
I belive they will go down. I don't think Vista is going to be a big hit at all, but rather turn people away with it's huge price tag and insane security checking.
Wow, it turned out that it couldn't comprehend this line:
sizeof text because parenthesis weren't there: sizeof(text)
Then, it's adhering to the age old standard of variables need to be declared before the 'block'.
This is the real line by the way:
if ( fgets(text, sizeof text, stdin) )
{
Thanks for all the replies.
To Dave: I loved the way your tutorial was dealing with input, but Miracle C is giving me the following error on the fgets line:
Parse Error, expecting `'(''
'if ( fgets(text, sizeof text, (&_files[0])) ) { int num'
aborting compile
Do you have any idea why it's saying that?
Is there any easy way to do this, or is hacking the final solution?
Not doing it is the final solution.
Hi Jwenting,
Don't say something like that. I know a message come from, Howerver I don't know what the trouble is, I 'm a new learner in Java. So if you are kind, Pls tell me what i should do and how ?
Regards,
We can't help you if you don't give us more information....
This:
"Usage: Java ATM databaseDriver databaseURL, Press any key to continue...."
Is not an error message. That is YOUR program running and displaying that message... If it's not displaying a 'form', then you didn't add it or create it..
I watched Brazil the other day play croatia, and I have to say, I was NOT impressed. Germany looks the best of any team (except for their defence).
I have the following simple piece of code:
double new_amount;
printf("Enter an amount: ");
scanf ("%d", &new_amount);
For some reason, it always give me zero as the new_amount no matter what I input.
What exactly am I doing wrong?
Also, is there a way I can do a little bit of error trapping in C like try-catch or maybe even just test whether the input IS numeric?
Hi all,I 'm writing a small program called ATM (Automatic Teller Machine) connected to Microsoft Access Database in Java. The program is complied without no fault, Howerver it doesn't display Form which I can enter user information (such as: accountnumber, pin,...). It shows:
"Usage: Java ATM databaseDriver databaseURL, Press any key to continue...."I 'm looking forward to receiving hepl from you soon.
Thanks and regards,
Hoang Van Cuong
I don't understand... The "press any key to continue..." tells me your program is running, right? Are you recieving any exception?
Jeez, I'm suprised. Nothing here about WC yet. I guess we don't got too many soccer fans here :sad:
Alrite, I wanna see 2 things posted:
1) Who ya want to win
2) Who will win
1) Germany or USA
2) Brazil
Create a JDialog and completely get rid of the bar?
they let them out?
My father was in the catholic school for boys, which was next door to the catholic school for girls.
High wall divided the playgrounds, and classes were timed so that boys and girls would not meet even on the way to and from school.That was in the 1940s of course.
It's actually a school for really young girls (around 8) that have VERY wealthly parents who have trouble controling them or don't want anything to do with them. It costs 60K for one girl to go to that school. The school is actually a mansion set about in a small neighborhood, so I don't think they really worry about boys running over ;) I'm sure they keep track of them, though.
Wow.........
I wish...
I could ever live near such beautiful babes.:lol:
I forgot to mention that I live near a bording school for bad chicks.
I'm shitzo so I can't tell what's real. I think I'm a wildebeast sometimes.
MAXIMUM PC is the best. I subscribe to PC magazine, Maximum PC and Fortune... Max PC is excellent for the latest hardware and techy stuff and Fortune for business.
I'm a terrible driver. I always have something going on in my mind and I forget about the road. There's been several times I've come close to running a red light... There are also some beutiful babes near where I live so I'm always staring at them rather than the road.
I say no to death penalty. Everyone deserves a second chance. Even criminals are human after all. But if ever they blow their "second chance", then OFF WITH THEIR HEADS!:mrgreen:
Study some statistics and you'll see criminals waste their second chance almost everytime... Especially those that commit high level offenses.
I'm not a member of any forums.
Is your applet signed? Applets cannot connect to files on a users system, which is probably why you are receiving the connection refused.
I really need help in computer projects can any one suggest me where to get computer projects please send in my mail .In case you are having one please attach it and send it in my mail. Hey it is dam URGENT my school is going to open within two days.PLEASE HELP ME.:sad:
I've stated this many times to others and they don't listen: Write a program that randomly selects a project for people like you.
What's the nature of the program? Are you trying to connect to something? Can you post the exact error message if there is one?
It'd be tough to implement a custom algorithm, I think. You're best bet would be to find some third party/open source frameworks for P2P...
It also makes the womens skirts seem shorter.
From what I remember, you can package the framework in your application, but I believe you need some sort of license... I could be wrong about that since it's been about 3 years.
Passing arrays is always a pain. I like how Dave just kept it in the public member section... Works out easier that way.
Sleep or prompt the user?
BufferedReader.readLine()?
The coolest programing language doesn't exist because I haven't made it yet.
Here's a search query on loop structures:
http://www.google.com/search?hl=en&q=java+looping+structures&btnG=Google+Search
I agree... Maybe a little outline would do the job?
The Java certification book gives you all the details about everything including interfaces and many other things. It's a MUST read if you want specifics.
If you use the FF toolbar thingy then it always gives 0 or N/A.
I think I am getting shorter and my wife is getting taller :lol:
I am 5' 10"
Hey, you live in North Carolina!
Is it weird I find that cool?
you tell me.... http://www.shocku.com/111/
Nope. I used to wrestle and I got to see some pretty bizarre and nasty injuries.
Wow, you people are weird.
Also, honestly, how long would it take someone like yourself to write a code such as my problem? 5 minutes maybe?
Java is not my cup of tea.
crock08
5 minutes max.
Although I sense some sarcasim, I would seriously pay you!
Ohhhhh, money talks. PM me.
Can someone please, please assist me with a java problem I'm having for an assignment in my class.
I'm completely lost in this class, have about 1 week left and just need help writing a basic program. Here it is... Any help would be greatly appreciated.
create a Java application that implements use of an int array. Use for loops to iterate through the array using the array’s length variable to stay within the array bounds. Fill and print the array.
Write this program as if you were explaining it to someone new to arrays. Fully document your code in such a way newcomers to Java will understand and be able to implement a Java array.
Thanks
Crock08
Sure. I'll write the whole thing for you.
Which loop statement? What is the exact line and exact error?
Oh well, I just took off all my subscriptions and reset my options. Now I don't recieve any replies.
Hey man, can I write this program for you?