Alex
Alex

Reputation: 434

Specific variable naming concerns in C

I am writing a program, and I just have to check: can I name a variable output or input? for example:

int output;
int input;

or is this a pre-assigned name for something else? The modules I'm importing for my program are:

#include <pwd.h>
#include <fcntl.h>
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <setjmp.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <readline/history.h>
#include <readline/readline.h>

Upvotes: 0

Views: 68

Answers (1)

Zig Razor
Zig Razor

Reputation: 3495

If there are collisions between your variables and any reserved words, the compiler will inform you with a warning or an error in compilation. So if the compilation doesn't produce any error, the names you assign the variables are good.

Upvotes: 1

Related Questions