Questions tagged as 'c'

2
answers

major / minor in vectors

I made some modifications to my code, it presents itself in modifications at the end of the post and I will modify it when I feel it necessary. Hello, I'm doing a college exercise, it's very simple, however, I'm having some difficulty in it, t...
asked by 06.08.2014 / 19:07
2
answers

What is the difference between these expressions?

In the srand manual man srand it says that srand has a unsigned int as its parameter, however when using it without cast the compiler does not complain. Is it possible to go wrong if you do not use cast (unsigned int) ? If ye...
asked by 30.08.2014 / 07:12
2
answers

Error when trying to pass a struct by reference in C?

I'm having pointers and I'm trying to do the following exercise: Consider a register of students enrolled in a course, with the following information for each student: • Student name: up to 80 characters • Registration number: represented...
asked by 09.09.2014 / 22:37
1
answer

Why does this code in c work?

When I call the function malloc , I have allocated space only for char , but it works for words of any size, so I was confused. #include <stdio.h> #include <stdlib.h> #include <string.h> int main(){ char *pal...
asked by 20.10.2018 / 00:46
1
answer

Cross-Reference with vector of pointers

I am creating a cross reference of a vector of pointers that calls a simple linked list. Aim is to type a sentence and decompose your words, placing them in each position of the vector according to their respective initial letter. #include...
asked by 12.10.2018 / 16:22
2
answers

Manipulation Directories java / python / c

I have a directory A, and this directory A has several subdirectories, and in each subdirectory, it has a variety of files. I would like to put the all files in a directory in the order they are in subdirectories, any idea how can I do this in j...
asked by 19.02.2014 / 05:01
1
answer

Dynamic allocation problem - realloc ()

I'm making a program that works as a payroll system, but I'm having problems in the dynamic allocation part. The program runs only once and stops. In int(main) I put: printf("Sizeof : %d\n",sizeof(funcionarios)); printf("Executo...
asked by 01.09.2018 / 21:12
1
answer

Assignment of operation in C

I do not understand why doing this operation, even if you have already declared r as float , if you do not put the cast operator it assigns a int . #include <stdio.h> void main() { float r; r = (float) 8 * 2...
asked by 21.08.2018 / 19:43
1
answer

Problem with vector with dynamic allocation

The intention of this program I am doing is to serve as if it were a banking system in which the amount of accounts to be created do not have a previously defined amount. In main() , I call the function inserir() , and print it right...
asked by 30.08.2018 / 15:59
2
answers

Concatenate Strings in C

Good afternoon, guys! I have a problem with Strings using the C language. The problem asks the user to enter a name, then type a special character, and lastly how many times he wants the character to be concatenated with the String. Howeve...
asked by 08.09.2018 / 14:00