0

so I'm pretty much stuck on the basics. I typed in the terminal to try and get a name, but if I try to type in the console, it states that there "is no such file or directory."

#include <cs50.h>
#include <stdio.h>
{
    printf("Your name:"); 
    string name = get_string();
    printf("Hello, %s\n," name); 
}

Then, when I type it in the console, this appears:

~/workspace/ $ ./initials
bash: ./initials: Is a directory
~/workspace/ $ ./string
bash: ./string: No such file or directory

Not sure what's going on. Any help would be appreciated!

1

Besides that, make sure you include,

int main(void)

since you are working in the main function.

0
0

You are not inside the directory that the file string or initials is. You have to get in the directory that the file string or initials is in, which is pset2, assuming you have kept the files in the folder pset2.

A simple way to do this is cd pset2 and then you may execute ./initials or ./string.

Your current directory, workspace is looking for a file called string or initials within workspace, not within workspace/pset2. The computer is very strict about the folders, files, and directories.

If this answers your question, don't forget to hit the green checkmark! Comment below if you still have questions.

You must log in to answer this question.

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