Questions tagged as 'c'

1
answer

Back to the beginning of the code after an if or switch case in C

I have a question regarding if . I'm developing a college semester program and every time I need to use a if and at the end of if , I need to go back to the beginning of the program. I'm having a hard time doing this. Examp...
asked by 25.11.2015 / 23:26
1
answer

What is the size of an enum in C?

In general, the enum stores an integer, can I consider that this is the size of it?     
asked by 26.01.2017 / 11:42
2
answers

Remove element from a linked list

I am implementing a chained list of type "with head". It follows struct referring to the list and creating it in main () struct lista{ int info; struct lista *prox; }; typedef struct lista Lista; int main () { Lista *l, *aux;...
asked by 21.09.2015 / 14:32
1
answer

Interoperability FORTRAN and C

Each language has a characteristic that makes it unique, this is fact! However, how do you work with code C in FORTRAN and vice versa? Is it possible to insert the code FORTRAN into C with the # include <>...
asked by 06.06.2015 / 19:35
1
answer

How does this code restrict entry to a number between 0 and 4?

I was answering this question, but it does not make sense to me. For me it would have to relate values smaller than 0 and greater than 4. I understood that I understood the inverse of alternative C.     
asked by 06.09.2015 / 02:23
1
answer

Why does not it give segmentation fault when I write to a char * without allocating memory?

My question is whether the compiler automatically allocates memory for the variable s1 char *s1; char s2[20]; //s1=(char*)malloc (sizeof(char)*20); s1="palavra1"; strcpy (s2,"palavra2"); printf("s1:%s\ns2:%s\n",s1,s2); Apparently...
asked by 26.04.2016 / 19:03
1
answer

Indirect sorting using index vector

Hello, I have a hard time resolving my workout and would like some help. I thought about doing with max heap, but it did not work. Here's the statement:    "Indirect sort problem".) Write an algorithm that receives an integer n and...
asked by 10.12.2015 / 02:11
1
answer

Sort algorithm does not work

There is something missing in the program. It checks the order with a single number or a single time. #include <stdio.h> #include <stdlib.h> /*4)escrever 10 números e ordenar em forma crescente e decrescente*/ int main() {...
asked by 15.04.2015 / 00:27
1
answer

Read a string of characters with scanf ()

My program should read large numbers ( 0 < = X
asked by 01.04.2015 / 07:00
3
answers

Incompatible types?

I'm passing 3 parameters: a vector with the names of 30 cities, one with the x coordinates of the respective cities and the other with the y coordinates. I need to print on the screen the cities to the north, south, etc. I'm still testing. I...
asked by 07.12.2014 / 02:37