what does this mean:
read value of the integer variable first_int from the user's input?
i dont know what's the proper c statement for this... i'm trying my code but there's always an error...

Recommended Answers

All 7 Replies

post the code you tried and the error message(s) because I am unable to see your monitor (I have bad eyes you know).

I think it means, read an integer as input from the user and assign it to the integer variable first_int.

int first_int;
scanf("%d",&first_int);

If you are still getting error, we need code and more detail to answer.

commented: Make people try and learn rather than giving them the codes directly from next time. :) -1
commented: does not deserve Neg Rep. +13

I think it means, read an integer as input from the user and assign it to the integer variable first_int.

int first_int;
scanf("%d",&first_int);

If you are still getting error, we need code and more detail to answer.

You think Ancient Dragon is so dumb that he couldn't give the simple answer you gave the OP ??? Just have a look at his reputation points and number of solved threads.
Its just the culture here to make people try and learn rather than given them the code well arranged in a golden platter.

I hope you being a part of the DANIWEB family now will help us carry this culture further and help people learn rather than giving them away the codes. :)

commented: *nods* +36
commented: Can you get any more extreme? It's a trivial 2 line snippet for god sake. No secrets of the programming elite were divulged here. Chill. -1
commented: lighten up. telling a beginner how to properly use 'slighten up, dude. instructing a beginner on how to use 'scanf' is hardly giving away trade secret. -2

1) I thought that 'bryangarcia' did not get the line

read value of the integer variable first_int from the user's input?

so, i helped him. It would have be a pity if the thread had dragged on just because the obvious possibility was not explored.
2)

Its just the culture here to make people try and learn rather than given them the code well arranged in a golden platter.

I am curious as to know as to how you would have made him learn to read an user's input into a variable.
3) My reply to the post does not question anyone's reputation. I hate it become such a bother to you, as it had nothing to do with you.
Next time I would make sure to check with you before giving any code on this forum:).

1) I thought that 'bryangarcia' did not get the line
so, i helped him. It would have be a pity if the thread had dragged on just because the obvious possibility was not explored.
2)
I am curious as to know as to how you would have made him learn to read an user's input into a variable.

1) Yes you helped him, but in what a way?
Many people here on Daniweb are great programmers, but they don't give away free code, they rather want to guide the OP through the process on how to achieve something so he can do it himself next time.
2) Well, I'll do my very best to explain it to you, one non-possible option is giving you free code, because we're arguing about that.

Let's start with the OP's question:

what does this mean:
read value of the integer variable first_int from the user's input?
i dont know what's the proper c statement for this... i'm trying my code but there's always an error...

He asked: What does this mean?
And: i dont know what's the proper c statement for this... i'm trying my code but there's always an error...
He explicitly tells us that he has tried it, not bad that he tells us, it's very very good that he tells us.
So a logical question from Ancient Dragon was: Could you show us your code?
If we had seen his code, then we could have explained him where he went wrong, so he wouldn't have made this mistake ever again.
Now he will probably just copy all your code, just to get his assignment done, not to learn in other words.
(The OP could just have STFW or read his textbook before asking this question)

To answer his question about that he doesn't know a proper C function for this: use scanf() , more information about [B]scanf()[/B] can be found here:
http://www.cplusplus.com/reference/clibrary/cstdio/scanf/
(It's even illustrated by a small example, and what a coincidence: in the example they also show you how to read an integer from the user).

To the OP:
If you've any more questions about scanf, then feel free to post them down as a reply on this thread.

commented: you're right... but there does come a point, where we (the so-called 'experts') have to give a line or two of code just to keep things moving. merely demonstrating correct use of "scanf" is not "doing his homework" +13

This thread is getting too far off-topic. If you all want to discuss this further then please start a new thread in IT Professional Lounge.

My action was a sincere effort to preserve the essence and culture of this community by telling a newbie more about Daniweb. Sorry if you guys (jephtah,tom gunn) felt it was extreme. By the way thanks for letting me know by -ve rep.Will take care from next time.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.