#Is it possible to use C on visual studio?

65 messages · Page 1 of 1 (latest)

runic path
#

I am trying to learn C and the other two later on. I was recommended by many to use visual studio. However, I do not see any mentions of C in it. So I wonder, is it possible to use C on visual studio? and while I’m at it, what files does C use?

wispy daggerBOT
#

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 use !howto ask.

burnt glacier
#

Visual studio's C++ workload does support C.

runic path
#

Do I use .cpp files?

burnt glacier
#

No, .c.

runic path
#

I can’t find a .c, am I looking at the wrong place?

burnt glacier
#

Huh?

#

You create a .c source file in your project.

runic path
#

what project type. I am mainly using it to mainly learn syntax atm

burnt glacier
#

C++ project.

runic path
#

but there’s stuff like “console app” or “class library” and hundreds of others

burnt glacier
#

Console app then.

runic path
#

empty project?

#

or console app

#

desktop wizard?

tidal merlin
burnt glacier
#

Either empty project or console app.

tidal merlin
#

been a minute since i did this

#

i got very annoyed by the version of C they were using, though -- that was back when they supported C89 and basically nothing else. nowadays you can specify that you wish to use C11 or C17 for more modern syntax

runic path
#

C23?

tidal merlin
#

nope, not in MSVC

runic path
#

alr

#

a little confused

#

created the project and idk how to open it

burnt glacier
#

It should have opened automatically.

runic path
#

well, there’s header files, resource files, source files, and external dependencies

#

and references

burnt glacier
#

Did you create an empty project?

runic path
#

I think so

tidal merlin
#

sounds like it did open. you'll have to create a .c file in the source files thingy

burnt glacier
#

So then you get started by right-clicking Source files and choose AddNew item.

#

You enter your source file name ending in .c.

runic path
#

but how to access that .c file after creating it?

burnt glacier
#

Double-click it.

runic path
#

do I need any sort of code before I write what I want to write?

tidal merlin
#

no? so long as you write code, anyways

runic path
#

I’m sorry if I sound pretty stupid, I am NEW new to C

#

should I take a look into keywords, reserved words, and some syntax?

tidal merlin
wispy daggerBOT
#
How to Learn C Programming

We generally recommend a good book to learn the necessary fundamentals:

To actually write and run C code, you will need a compiler, editor, and debugger. We strongly recommend to start out using an IDE, which will provide all these tools for you:

<:microsoft:1165512917047853127> Windows
  • [Visual Studio](#1165492293810257920 message)
  • CLion
<:tux:1165505626894520361> Linux
<:apple:1165508607798943754> Mac
runic path
#

do they have strings and characters?

burnt glacier
#

Yes.

runic path
burnt glacier
#

Go with a course, that will explain things to you.

runic path
#

sure, what can I use to learn?

tidal merlin
# runic path what is the #include <stdio.h> for?

#include <whatever> is a thingy that (generally) gives the compiler a list of functions and other definitions you can use to do whatever with. printf() is defined in stdio.h, hence stdio.h needs to be #included. the complete list of functions in stdio.h are

#

!man stdio.h

wispy daggerBOT
#

stdio - standard input/output library functions

Synopsis
#include <stdio.h>

FILE *stdin;
FILE *stdout;
FILE *stderr;

burnt glacier
runic path
#

linux? I’m using windows 11

#

is that a concern?

tidal merlin
#

only a little, and not for this stage of learning. if you want to use linux, install WSL

runic path
#

I’m just gonna look at the basics and take notes on it

#

it could be a smart… or stupid choice to make

tidal merlin
# runic path sure, what can I use to learn?

i recommend reading the man pages -- you could start by googling man 3 intro and man stdio.h and following the "See Also" sections until you get bored. you can also look up individual functions in the man pages via man 3 printf (the 3 is to make sure you get the right one -- man 1 printf also exists, most functions won't need that)

burnt glacier
runic path
burnt glacier
#

You don't have to use Linux.

#

Not sure which link you clicked.

runic path
burnt glacier
#

Well @mage is using Linux docs.

tidal merlin
# runic path the “stdio(3)”

that page references a standard library header, it will be universal. there will be references to non-standard library functions that are linux-specific, but those will be rare, and not in the standard library header pages

runic path
#

Do you have any recommendations on what I could use to learn the basics of C?

tidal merlin
# wispy dagger

there's the first 4 links in this and the man pages i linked. that should be more than enough to get started, i'd think

runic path
#

!solved