Skip to main content

Questions tagged [expected-expression]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
83 views

CS50, week1, lab1, population of llamas, an error keeps showing up for the line of int years = 0, the error is expected expression, Why is that?

#include <cs50.h> #include <stdio.h> int main(void) { // TODO: Prompt for start size int start; do { start = get_int("start size: "); } while (...
Hussien.Abdelbaky's user avatar
0 votes
1 answer
442 views

How to solve "error: expected expression" while doing Caesar.c

I'm trying to solve Caesar but i keep getting this error: caesar.c:37:20: error: expected expression s[i] = char(int(text[i]+k-97)%26+97); \\ the arrow points to the 'c' in char #include <ctype.h&...
Andrew Saad's user avatar
0 votes
1 answer
725 views

Expected Expression Error

I have been working on cs50 problem set 2 and I have come across the error readability.c:35:1: error: expected expression else if( index > 16) ^ My code is as follows if(index < 1) { ...
cs50studnt2021's user avatar
0 votes
1 answer
255 views

Cash.c:11:24: error: expected expression

#include <cs50.h> #include<math.h> int main(void) { int n = 0; do { n = (get_float("Change owed: ") * 100); } while (n < 0); int q = ((n / 25) %) ...
Firestar464's user avatar
0 votes
1 answer
361 views

During PSET 2: Substitution, I got an expected expression error for get_string. Please help

substitution.c:24:23: error: expected expression char* plaintext = get_string(); ^ /usr/include/cs50.h:109:53: note: expanded from macro 'get_string' #define get_string(...) ...
Shushank Chaudhary's user avatar
0 votes
1 answer
69 views

Pset 2 Caesar "Expected Expression" - If statement

For the Caesar pset, I am having trouble trying to fixing an expected expression error. for (int i = 0; i < int n = strlen(argv[1]); i++) { printf("test"); } The condition inside the for-...
Maelgwn's user avatar
0 votes
1 answer
99 views

"Expected Expression" Error on Move Function

I am having a problem compiling fifteen.c. When I try to compile, I get an error in the move function saying: fifteen.c:225:27: error: expected expression coord_t = {i, j}; ...
Smithey's user avatar
  • 103
0 votes
1 answer
45 views

Pset3 Find - error in "helper" file - 'expected expression'

This is my code for the helper.c file. The code forms part of the 'find' program. I'm getting an error: 'expected expression' re: the last 'else' statement. I have tried removing the 'else' statement ...
Android1's user avatar
0 votes
1 answer
511 views

pset1 - Greedy Errors "error: expected expression"

Please help! I cant solve some errors (from: [http://docs.cs50.net/problems/greedy/greedy.html][1]) running this code: int main(void) { float change = 0; int coin_used = 0; int change2 = ...
Pablo Dip's user avatar
0 votes
1 answer
118 views

pset1 mario: error: expected expression

I've looked over some of the other threads and I am still puzzled. I keep getting an error: expected expression for line 21:5 (the ending curly bracket for my do loop). Here's my code so far: #...
Lee Gainer's user avatar
0 votes
1 answer
91 views

expected expression pset5 dictionary.c if-else

I am having troubles with the check function in dictionary.c in pset5. Here is my code: /** * dictionary.c * * Computer Science 50 * Problem Set 5 * * Implements a dictionary's functionality. ...
Jon's user avatar
  • 23