0

I wrote this code for the mario problem but idk if it's right. i'm having trouble running it. It keeps saying error: linker command failed with exit code.

#include <cs50.h>
#include <stdio.h>

int main(void)
{
    int n;
    do
    {
        n=get_int("height: "):
    }
    while (n<1 || n<8);

    for (int i=0; i<n; i++)
    {
        for( int j=n-i; j<n; j++);
        print (" ")
    }
    {
        for (int k=1; k<n; k++)
    }
    printf("#");
    printf("\n");
}
0

nvm i got it but it still says i got an error with the brack after for (int k=1; k<n; k++)

| improve this answer | |
  • That would be one of numerous syntax errors in the code. Should be easy to resolve. – Cliff B Jun 24 at 3:07
0

There are a number of syntax errors in the code, but that's not the problem if you're getting a linker error. This usually means that there's a problem with the actual compiler commands.

You should be using make mario in the same directory as mario.c file. If you're in another directory, or manually trying to compile and link, then it depends on the command. If this doesn't resolve your problem, please edit the question and add a screenshot of the entire IDE window with an attempt to make your executable.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .