#C wont work

42 messages · Page 1 of 1 (latest)

old palm
#

one time i was just learning C in visual studio and none of my programs would work

latent heathBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

knotty kindle
#

Send more info

#

Look at what errors it’s giving you

twilit mauve
old palm
glad comet
#

Visual studio is fine for now realistically

#

what are you actual error messages though

#

itll tell you in the output window

#

c programs do lots of checks during compilation before you get an executable out the other end. So it could be from a syntax error (e.g. missing a semicolon) or a type-checking error (using the wrong types) or linking error (using functions which dont exist) or a whole host of things

#

The only way to know is to read the error messages

limber wedge
#

starting with C on VS is like giving a brick to a toddler

twilit mauve
# old palm I dont want to use a third party compiler so wich one should i use then(also i a...

Compiler and IDE/text editor are different things.
Your compiler is probably either GNU GCC (Linux) or MinGW (Windows). Possibly it's clang but if so then I have no clue. Also if you're not forced to use MinGW then you'll likely do yourself a favour to use GNU GCC under Linux. What I did and what I'd recommend is to buy a 120-250 GB SSD that you install Linux on and everytime you want to do work with C you boot to this drive. This has the beneficial side effect of removing many distractions like f.e. games. If you can't get an SSD then Windows nowadays has WSL (Windows Subsystem for Linux) natively built in, which allows you to emulate a Linux operating system. Even better, WSL is supported by VS Code (via a plugin or natively, not sure), meaning you can write code with your VS Code opened under Windows, but it has access to this WSL.
VS Code is an extensible text editor, i.e. it's just an editor that you can "upgrade" with plugins, but under the hood all these plugins rely on you having a compiler.
My suggestion as mentioned before is to use VS Code together with a C linter (i.e. a plugin that does syntax highlighting plus more stuff like f.e. providing signatures + documentation for functions/libraries).
To compile and run your code I would suggest using the terminal in the working directory with the commands gcc your_file.c -o -output_file.o and ./output_file.o. Once you've done that a few times you can start into looking what Makefiles are to shorten this process to simply typing make run or something alike. Don't forget that arrow key UP lets you repeat your latest commands.

exotic pelican
#

linux is the best compiler

limber wedge
exotic pelican
#

the mans porgrmans wont work

limber wedge
exotic pelican
#

what do you know you have a book on your head

limber wedge
#

Haha, well, the book on my head might be a silly look, but it doesn't change the fact that Linux isn't a compiler

exotic pelican
#

you sound like chatgpt

limber wedge
#

What does that even mean

limber wedge
limber wedge
limber wedge
exotic pelican
idle willow
old palm
latent heathBOT
#

This question is being automatically marked as stale.
If your question has been answered, run !solved.
If your question is not answered feel free to bump the post or re-ask.
Take a look at !howto ask for tips on improving your question.

exotic pelican
#

why do people say that an IDE is a text editor and compiler is not part of the IDE like that's the whole point of IDE it's in the name "integrated development environment" meaning everything is there

knotty kindle
#

IDEs, ideally, make working with the environment easier. It does not mean they bundle the entire environment

#

Python IDEs don't manage pip packages or python installations. But they might help with virtual environments or conda environments. If that example is helpful for you.

exotic pelican
#

all I can say is in my experience an IDE makes everything pointlessly harder

#

less software in the way of what you want to do with a computer is better

#

and also, I hate javascript

exotic pelican
#

i prefer to use tty1 for everything