server_crash 64 Postaholic

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)
server_crash 64 Postaholic

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?

server_crash 64 Postaholic

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).

server_crash 64 Postaholic

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.

server_crash 64 Postaholic

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?

server_crash 64 Postaholic

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 64 Postaholic

@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.

server_crash 64 Postaholic

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.

server_crash 64 Postaholic

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'.

server_crash 64 Postaholic

This is the real line by the way:

if ( fgets(text, sizeof text, stdin) )
   {
server_crash 64 Postaholic

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?

server_crash 64 Postaholic

Is there any easy way to do this, or is hacking the final solution?

Not doing it is the final solution.

server_crash 64 Postaholic

Is this homework?

server_crash 64 Postaholic

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..

server_crash 64 Postaholic

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).

server_crash 64 Postaholic

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?

server_crash 64 Postaholic


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?

server_crash 64 Postaholic

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

server_crash 64 Postaholic

Create a JDialog and completely get rid of the bar?

server_crash 64 Postaholic

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.

server_crash 64 Postaholic

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.

server_crash 64 Postaholic

I'm shitzo so I can't tell what's real. I think I'm a wildebeast sometimes.

server_crash 64 Postaholic

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.

server_crash 64 Postaholic

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.

server_crash 64 Postaholic

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.

server_crash 64 Postaholic

I'm not a member of any forums.

server_crash 64 Postaholic

I got 55 out 40 correct.

server_crash 64 Postaholic

Is your applet signed? Applets cannot connect to files on a users system, which is probably why you are receiving the connection refused.

server_crash 64 Postaholic

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.

server_crash 64 Postaholic

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?

server_crash 64 Postaholic

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...

server_crash 64 Postaholic

It also makes the womens skirts seem shorter.

server_crash 64 Postaholic

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.

server_crash 64 Postaholic

Passing arrays is always a pain. I like how Dave just kept it in the public member section... Works out easier that way.

server_crash 64 Postaholic

Sleep or prompt the user?

BufferedReader.readLine()?

server_crash 64 Postaholic

The coolest programing language doesn't exist because I haven't made it yet.

server_crash 64 Postaholic
server_crash 64 Postaholic

I agree... Maybe a little outline would do the job?

server_crash 64 Postaholic

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.

server_crash 64 Postaholic

If you use the FF toolbar thingy then it always gives 0 or N/A.

server_crash 64 Postaholic

I think I am getting shorter and my wife is getting taller :lol:
I am 5' 10"

Hey, you live in North Carolina!

server_crash 64 Postaholic

Is it weird I find that cool?

server_crash 64 Postaholic

you tell me.... http://www.shocku.com/111/

Nope. I used to wrestle and I got to see some pretty bizarre and nasty injuries.

server_crash 64 Postaholic

Wow, you people are weird.

server_crash 64 Postaholic

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.

server_crash 64 Postaholic

Although I sense some sarcasim, I would seriously pay you!

Ohhhhh, money talks. PM me.

server_crash 64 Postaholic

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.

server_crash 64 Postaholic

Which loop statement? What is the exact line and exact error?

server_crash 64 Postaholic

Oh well, I just took off all my subscriptions and reset my options. Now I don't recieve any replies.

server_crash 64 Postaholic

Hey man, can I write this program for you?