Questions tagged as 'c'

1
answer

Store more than one value in a variable with &&

Can I store more than one number in a variable? For example: m= a&&b&&c&&d&&e I need to indicate which is the largest and the smallest number that the user entered, wanted a way to do this without having to t...
asked by 03.04.2018 / 16:02
1
answer

Static functions in C

I noticed that some libraries use functions and static variables, such as static int sum(lua_State *state) . This function belongs to a library that will be compiled into the Lua language. But also libraries with dlsym calls...
asked by 14.12.2016 / 05:37
1
answer

Double-chained list in C [closed]

Edited code I'm having trouble removing function #include<stdio.h> #include<stdlib.h> #define MAX_NOME 50 typedef struct pessoa{ char nome[MAX_NOME]; int idade; }Pessoa; struct celula{ Pessoa *conteudo; struct ce...
asked by 27.09.2015 / 23:30
1
answer

In C / C ++, what are the build directives for? When should I use them?

I came across a C code that used a compilation directive in #ifdef and I do not quite understand what it's for. I found an explanation, but it was not clear. Here's an example policy and the explanation I looked for: #ifdef <token>...
asked by 04.10.2015 / 01:22
2
answers

Error reading file in C

But before doing this code I created a text file called numero.txt and included in the file: 23;45;89;-230 452;0;97;1 87;2;4;6 346;97;-5;3 Following is an error code, but I can not find the error. #include<stdio.h> void main(){...
asked by 01.06.2016 / 19:43
1
answer

C menu that moves with the arrow keys?

I once saw an algorithm in C where in the menu selection had a "mini navigation" if I can call it that way, where I used the arrow keys to navigate the menu and enter to select the option, I was curious to know how do that, can someone show? Tha...
asked by 15.06.2016 / 21:32
1
answer

Char comparison, ignoring case sensitive

The proposal is to create a program that compares the n positions of the two vectors and returns whether they are equal or not. So far so good, but I do not know how I can ignore case sensitive . Here's what I've done so far: //Questão 7...
asked by 09.07.2016 / 03:10
2
answers

unix and linux are reserved words?

Even though I do not declare the variables unix and linux and even not include anything in my teste.c compiling with GCC on Linux I have: Compilation gcc teste.c -o teste Execution ./teste Output...
asked by 11.10.2015 / 03:18
1
answer

Generate random number between -99 and 99 [duplicate]

I'm having some difficulty here in my code which is as follows, I know that to generate random numbers between 0 and 9 is - x = rand() % 10 . So now I wanted to generate numbers between -99 and 99 , and I di...
asked by 16.10.2015 / 06:17
1
answer

Include a .c file within a main project.c

I am developing a simple program to deliver at the end of the first semester and would like to know if it is possible to create a main project and make the menu in a separate menu.c . Then include the menu.c file inside the main project?...
asked by 25.10.2015 / 22:15