Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
greedy.c, one of the assignments in Problem Set 1, asks you to develop a "greedy algorithm" to calculate the minimum number of coins needed to make change, while demonstrating an understanding of floating point number storage in a computer.
0
votes
1
answer
38
views
getting error message for greedy expeted identifier
jharvard@appliance (~/Dropbox/pset1): make greedy
clang -ggdb3 -O0 -std=c99 -Wall -Werror greedy.c -lcs50 -lm -o greedy
greedy.c:13:4: error: expected identifier or '('
{
^
1 error generated … .
make: *** [greedy] Error 1
Here is the code it refers to:
#include <stdio.h>
#include <cs50.h>
#include <math.h>
int main (void);
int money;
int quater;
int dime;
int nickle;
int penny;
{
do …
0
votes
1
answer
60
views
Error Message while doing Greedy for declared variable
greedy.c:8:7: note: previous definition is here
int i;
This variable has been declared and used and I am getting this error message.
If I remove the declared variable then it tells me I didn't de …