Forum: C Mar 23rd, 2009 |
| Replies: 5 Views: 433 DON'T SHOUT SO LOUD!
I have delicate ears you know... |
Forum: C Feb 14th, 2009 |
| Replies: 6 Views: 436 I think you are referring to your course notes here.
I hope you can read your own language : Habla espagnol?
I googled with bit operations in C the first hit I got was
... |
Forum: C Feb 14th, 2009 |
| Replies: 6 Views: 436 THe best tutorial I can think of is your course notes and your textbook. Or are you missing both?
At least show us what you already have. Please? |
Forum: C Jan 19th, 2009 |
| Replies: 5 Views: 1,258 You do not need to free local variables when the function ends. Where would they be anyway? Who or what could still access them? |
Forum: C Jan 4th, 2009 |
| Replies: 15 Views: 964 The thing is that enum in C are a sort of integer constants.
So you could also use #define Sunday 0 to accomplish the same thing. You could let the user input a number or character and then add a... |
Forum: C Jan 4th, 2009 |
| Replies: 15 Views: 964 Comment out the scanf for the moment. |
Forum: C Jan 4th, 2009 |
| Replies: 15 Views: 964 Try
today = Sunday; or today = Friday; |
Forum: C Jan 4th, 2009 |
| Replies: 15 Views: 964 An enum under the hood is stored by most compilers as an integer so the name Sunday is really a placeholder for the integer value 0. Monay evaluates to 1, Tuesday to 2 and so on.
You are giving the... |
Forum: C Nov 9th, 2008 |
| Replies: 2 Views: 1,745 You want to print a table with the powers of 2 and you want your integers to be signed and unsigned. You're making it to complicated I think, use \t to separate your output. Or use something like... |
Forum: C Oct 29th, 2008 |
| Replies: 9 Views: 829 |
Forum: C Oct 29th, 2008 |
| Replies: 9 Views: 829 Well I shall do the reverse:
Take 101
Instead of divide, multiply by 2 for every "remainder":
1 x 2^0 = 1
0 x 2^1 = 0
1 x 2^2 = 4
1+0+4=5 decimal which is 101 binary. |
Forum: C Oct 29th, 2008 |
| Replies: 9 Views: 829 I don't know what your problem is, but I appreciate your efforts.
Divide your decimal number by 2. Record the remainder(should be 0 or 1) divide again and record again until your decimal number... |
Forum: C Oct 27th, 2008 |
| Replies: 22 Views: 1,829 OK use a post-test loop. Where in your question is mentioned that you may not use for, if, break or whatever at the same time? |
Forum: C Oct 26th, 2008 |
| Replies: 12 Views: 969 The trills you get when some code is working can not be described by someone who has never written some code...
Mark thisone as solved... |
Forum: C Oct 26th, 2008 |
| Replies: 12 Views: 969 Code tags :
Select your code.
Then click one of the buttons on top of the field where your typing or pasting text.
Hover over all of them to get their meaning. You need the #-button.
Code... |
Forum: C Oct 26th, 2008 |
| Replies: 12 Views: 969 Why do you make it so complicated?
You can do with one while!
And please : if you send code put it between CODE-tags |
Forum: C Oct 26th, 2008 |
| Replies: 12 Views: 969 main()
{
int num, i;
while(num>1) <-----
{
What do you think the value of num is where I put the arrow?
Most likely it will be zero but you can never be certain about that.
Put your scanf... |
Forum: C Oct 26th, 2008 |
| Replies: 6 Views: 1,215 Could it be that your return statement in the sum-function is in the for-loop?
It is indented that way. |
Forum: C Oct 24th, 2008 |
| Replies: 3 Views: 398 set choice to 3 before the while-loop
do the scanf in the
while loop
1--func 1
2--func 2
3--quit the while loop , do something like while (choice != 3) etc. |
Forum: C Oct 24th, 2008 |
| Replies: 3 Views: 398 In your while loop, you never change the choice variable to something else then 1.
It is testing for choice==1 or choice==2 so it will keep looping forever. |