C Language

Hey All…

As I delve into RobotC, I’m kinda disappointed in the scope of the language. Is it possible to add to RobotC with additional libraries with an #Include statement.
I kinda miss Do-While loops and Select Case statements.

Probably not but I had to ask. Yeah, those can be imitated. Just not easily… at least in my experience.

Anyhow. Thanks for your Wisdom!

Amanda

Pretty sure both do…while and switch statements are supported.

ROBOTC does not support libraries in quite the same way as traditional C, but you can include other source files and also set user specified locations for those files so several programs can use them.
Perhaps look at some existing ROBOTC programs, here’s an old one with some examples.

also, you will find some old student code in these repos.

3 Likes

From my quick google search of ‘Select Case’ statements, you may not come from a C language background, so you may want to familiarize yourself with it.

Alternatively, there are some community developed solutions for programming the cortex that use a more standard C library and programming environment. I’d recommend looking into PROS https://pros.cs.purdue.edu/cortex/getting-started/index.html
Make sure you look at the PROS 2 docs for cortex, as the PROS 3 docs are for V5. Also make sure you use the PROS 2 download instead of the PROS 3 download.

PROS itself has a CLI, so you can use pretty much any editor that you want.

7 Likes