I'll keep that in reference when i learn buff and fgets.
Type: Posts; User: OmnipotentCow
I'll keep that in reference when i learn buff and fgets.
Hmmm.
I think learning how to change programs for the complete idiot will be harder than learning the language itself.
Someone wanna write a faq on this?
Well if the user is stupid enough to regard "Enter a letter:" as, let me enter 2 or more...
Then what can I say? Its simple intructions if you ask me.
Oh I see what you mean by extra variable now.
Thought you had to give getchar() a variable so it can be used.
*oh powerful all knowing programmer, please forgive my noob like thinking*
Then i would like you to try making my code, and omit using another variable.
And if you ask me, my code is perfectly fine. Because it does exactly as i want.
Alright, I belive i understand now
#include <stdio.h>
int main()
{
char first;
I need help with understanding how to recieve single character input, and use it the correct way.
This book I'm learning from is kind of shakey on this subject, and mainly goes into strings of...
Here's a question.
Try doing your own homework?
Ya, now that i really think about it, it's pretty much the same as pirating software or what not.
Oh well, just a thought i had when reading through this book.
Is there a way to take a executable file, and turn it into source code you can read and edit?
I looked on my compiler options, and it has nothing like this it seems.
You have to name your files "prog.c" for C?
I've been saving them as .cpp, and they have been compiling all just fine.
BTW, i use borland's free compiler.
Oh, belive me. I would never actually use things like BEGIN and END in replace of brackets, or any other significant functions or anything.
Its just this program I am writing would have seemed...
You obviously dont understand what I'm saying then if you think i have no clue what the %d does.
The effect I'm trying to get to is how you can change the "{" and "}" into the words BEGIN and END....
Problem goes out like this.
I want to replace the %d with, say, letter Q.
Problem is, when I use the Q instead of %d inside printf statements, the printf prints out the Q, instead of the...
You can also run a for statement for it.
int array[5];
int j;
for (j = 0; j <= 5; ++j)
lol 1998..
i meant 1988.
Damn, answered all my questions.
Thanks a lot, book neglected to mention i need to declare functions when using main() it...
And yes, this would be old style C, because the book is old......
And also, while on the subject of functions, what does the returning value of a function actually do?
Basically, what is the use of having a function return a value, and how is it used.
#include <stdio.h>
main()
{
int first,second;
printf("Enter a number: ");
scanf("%d", &first);
printf("\nEnter another number: ");
ohhhhhhhhhhh, oh yea. Didn't think of libraries.
That fixed the problem Monster.
Thanks all.
Oh yea, forgot to mention something. When i refered to the output being random characters, i meant that when i ran a printf function to print the variable "user", thats when it came with random...
Ok, i could use just y and n, but Id prefer using yes and no.
So what do i have to do to be able to use yes and no for input.
And the %s doesnt work.
Another note, i thought the problem...
I'll start by giving the code
#include <stdio.h>
int main()
{
char user[10];
char enter[10];
Thank you, that fixed the problem. Seems this book I'm learning from decided that learning ^ is integer exclusive isn't that important.
And no, I did not read that post. Thanks for the info...
Hello, I have just got into learing to program (In C), and I'm having a problem with floating point.
It's a simple get the volume of a circle if given a radius problem.
#include <stdio.h>
...