Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C Programming in Visual Studio - Go To Definition Descriptions

I'm trying to find C function descriptions or definition bodies using Visual Studio. When I go to definition, it takes me to the header declaration which isn't very useful. Sure I can see the signature but that's not much. If I go to the definition in the header file, it doesn't take me to the source code where the comments/body may be. Anyone know how to get more info within VS?

Before GoTo

enter image description here

like image 705
user3746195 Avatar asked Aug 03 '20 02:08

user3746195


People also ask

How do you jump to define in VS code?

Go to Definition If a language supports it, you can go to the definition of a symbol by pressing F12. Tip: You can jump to the definition with Ctrl+Click or open the definition to the side with Ctrl+Alt+Click.

How do I see definitions in Visual Studio?

If you are a keyboard user, place your text cursor somewhere inside the symbol name and press F12. If you are a mouse user, either select Go To Definition from the right-click menu or use the Ctrl-click functionality described in the following section.

How do you go back after going to definition or code?

Go to Definition Select a symbol then type F12. Alternatively, you can use the context menu or Ctrl+click (Cmd+click on macOS). You can go back to your previous location with the Go > Back command or Ctrl+Alt+-.


1 Answers

No, you cannot get the source code directly from your system/PC because the library files are first compiled and then stored as .a(Unix) or .lib(Windows) static files / .so(Unix) or .dll(Windows) dynamic files.
Note: Similar answer is mentioned in the comment section as well by others.

However, you can download the source codes of various implementations. For starter, you can go to GLIBC and download the source code from there. Instructions to download are mentioned on the website itself.

like image 156
Sourabh Choure Avatar answered Sep 30 '22 06:09

Sourabh Choure