Skip to main content
remove red herring
Source Link

You are very much on the right track with this one. I would not worry about the fact that you are implementing an array solution before arrays are covered in the lectures. What matters is that you understand when and how to use them. If your program passes check50 then you wrote a good program.

It looks like you are not doing anything with coin_val... do you maybe want to add it to something?

Edit: I was wrong in my description of increment operators, see gnu c manual

You are very much on the right track with this one. I would not worry about the fact that you are implementing an array solution before arrays are covered in the lectures. What matters is that you understand when and how to use them. If your program passes check50 then you wrote a good program.

It looks like you are not doing anything with coin_val... do you maybe want to add it to something?

Edit: I was wrong in my description of increment operators, see gnu c manual

You are very much on the right track with this one. I would not worry about the fact that you are implementing an array solution before arrays are covered in the lectures. What matters is that you understand when and how to use them. If your program passes check50 then you wrote a good program.

It looks like you are not doing anything with coin_val... do you maybe want to add it to something?

My description of incrementing was wrong. added link to docs
Source Link

You are very much on the right track with this one. I would not worry about the fact that you are implementing an array solution before arrays are covered in the lectures. What matters is that you understand when and how to use them. If your program passes check50 then you wrote a good program.

As for your error, reading the message seams to indicate that i++ is evaluated after the index to coin_val is looked up. Also because i++ is setting i inplace it isnt clear that the indexing operation would have acces to a returned value from i++.It looks like you are not doing anything with coin_val.. Think of ++ as a function that returns void, or nothing at all. do you maybe want to add it to something?

Try seperaing the incrementer and the indexing into two seperate lines.Edit: I was wrong in my description of increment operators, see gnu c manual

You are very much on the right track with this one. I would not worry about the fact that you are implementing an array solution before arrays are covered in the lectures. What matters is that you understand when and how to use them. If your program passes check50 then you wrote a good program.

As for your error, reading the message seams to indicate that i++ is evaluated after the index to coin_val is looked up. Also because i++ is setting i inplace it isnt clear that the indexing operation would have acces to a returned value from i++... Think of ++ as a function that returns void, or nothing at all.

Try seperaing the incrementer and the indexing into two seperate lines.

You are very much on the right track with this one. I would not worry about the fact that you are implementing an array solution before arrays are covered in the lectures. What matters is that you understand when and how to use them. If your program passes check50 then you wrote a good program.

It looks like you are not doing anything with coin_val... do you maybe want to add it to something?

Edit: I was wrong in my description of increment operators, see gnu c manual

Source Link

You are very much on the right track with this one. I would not worry about the fact that you are implementing an array solution before arrays are covered in the lectures. What matters is that you understand when and how to use them. If your program passes check50 then you wrote a good program.

As for your error, reading the message seams to indicate that i++ is evaluated after the index to coin_val is looked up. Also because i++ is setting i inplace it isnt clear that the indexing operation would have acces to a returned value from i++... Think of ++ as a function that returns void, or nothing at all.

Try seperaing the incrementer and the indexing into two seperate lines.