Questions tagged [syntaxerror]
The syntaxerror tag has no usage guidance.
15
questions
0
votes
0
answers
168
views
RuntimeError: near ",": syntax error
I'm struggling with my final project. I try to query database for income items ( in "income" table) to sum them up finally, but each time I get the syntax error. The funny thing is that it ...
0
votes
1
answer
335
views
Error: function definition is not allow here What error is this?
main.c:10:24: error: function definition is not allowed here
int read( int a[9][9]){
^
main.c:36:24: error: function definition is not allowed here
void show(int a[9][9]){
^
main.c:58:24: error: ...
0
votes
2
answers
1k
views
CS50 AI Problem 1A Invalid Syntax
For CS50AI Problem 1 (Knights), I am really confused as to what is producing this error.
Code:
from logic import *
AKnight = Symbol("A is a Knight")
AKnave = Symbol("A is a Knave")
BKnight = ...
0
votes
1
answer
60
views
CS50 2018 Lecture 1C. Unable to figure out syntax error in code
My code :
#include <stdio.h>
#include <cs50.h>
int get_positive_int(string prompt);
int main(void)
{
int i = get_positive_int("Positive interegr: ");
printf("%i\n", i);
}
int ...
0
votes
1
answer
333
views
Pset8 Finance problems with SQLite inserting into a table
Inserting into a table in finance.db fails. I'm able to run the sqlite3 command via cli without errors and populate the table with the debugging snippet command:
INSERT INTO history (date, symbol, ...
0
votes
1
answer
289
views
cs50 pset 1 greedy algorithm
#include <cs50.h>
#include <stdio.h>
#include <math.h>
int main(void)
{
float y;
do
{
y = get_float("Change: ");
}
while (y < 0);
printf("%f\n", y * 100);
...
0
votes
1
answer
307
views
pset 7 survey: trying to redirect to /sheet returns invalid syntax error
For part of CS50's survey problem from pset7, I'm supposed to redirect from a route that checks if the user has entered in all the survey's fields / appends the values to a csv file --> a route that ...
0
votes
1
answer
1k
views
Error on second line of code "int main(void)" while executing
#include <stdio.h>
int main(void)
{
printf("hello , world");
}
$ clang welcome.c
$ ./welcome.c
./welcome.c: line 4: syntax error near unexpected token `('
./welcome.c: line 4: `int main(...
0
votes
1
answer
335
views
pset7- finance register invalid syntax error
I am just starting pset7 and I thought I had fully completed register, but I keep getting an invalid syntax error on this line:
if not result:
I am really confused as this is a really simple line ...
0
votes
1
answer
309
views
PSET 6: Caesar.py - stuck on "SyntaxError: invalid syntax"
For my caesar implementation in Python, the CS50 IDE keeps telling me that I have a syntax error at the else portion of my for loop as shown below. Any help would be GREATLY appreciated! Haha, thanks ...
0
votes
2
answers
29
views
Not a problem set, but a question about the "sizeof" example from week 1 walkthroughs
I've been trying to follow along with all the examples in the walkthrough and there's something that I can't get to work and I can't for the life of me figure out WHY I keep getting this error message....
0
votes
1
answer
37
views
Error in my final project
So I am working on my final project and when I try to compile I get this error :
mpg.c:169:1: error: expected '}'
^
mpg.c:133:2: note: to match this '{'
{
^
mpg.c:169:1: error: expected '}'
^
mpg.c:...
0
votes
1
answer
1k
views
syntax error, unexpected 'for' T_FOR
I got this error syntax error, unexpected 'for' T_FOR for a function that uses a for loop. However, I can't point out what's the mistake. All the semicolons and variables are in place supposedly
...
0
votes
1
answer
232
views
Syntax error: newline unexpected
I'm still working on the cs50 application (it's still 2015 right?) and got a problem with pset6.
Basically I am getting a Syntax Error:
/path/to/hello.html: 2: /path/to/hello.html: Syntax error: ...
0
votes
1
answer
330
views
pset 8 mashup getJSON fails even though I am feeding it valid json
My google url shortener implementation as the "extra feature" has gone on for two weeks. I've struggled with this last little detail. Although I get a kick out of seeing most of the code function, the ...