Questions tagged as 'c'

3
answers

I'm trying to register in C, but the code does not let me put the address

I'm trying to register in C, but the code does not let the address and when I put the option to end the registration the program crashes and stops working. What am I doing wrong? #include <stdio.h> #include <stdlib.h> int main() {...
asked by 30.10.2017 / 14:02
1
answer

Problem with switch C

I have a code in C, and without the switch, it works fine, but with switch, when inserting name in the list, it replaces all the name of the list with the same one. void insChild(LIST* l, char name[]) { NO* new; NO* p; p = LastChild(*l);...
asked by 16.10.2017 / 19:04
1
answer

How does malloc organize memory?

When I allocate memory with malloc() , are the addresses equal to a vector? Or are they scattered in the memory of the PC? I want to create a list of structs , to do this, I have to have several structs in case, can I do th...
asked by 10.11.2017 / 18:07
1
answer

Struct address for INT

I have the following Struct: struct nodo{ int elo_a; char nick[26]; char cidade[16]; int idade; int elo_p;}; I have two struct assignments: struct nodo *variavel; struct nodo *offline; Okay, I already inserted a value in offline, sett...
asked by 07.11.2017 / 01:34
2
answers

Inserting elements into a dynamic list

I did this function, but I do not know if it's right, it does not give the compilation error, but it gives an error when prompt appears that the program stopped working. Insertion at startup: int inserir_no_inicio_da_lista (Lista* li...
asked by 04.10.2017 / 14:37
1
answer

How to pass structure to function?

   An agency in a country town has a maximum of 10,000 customers. Create an algorithm that can enter account number, name and balance of each client. The algorithm should print all accounts, their balances and one of the messages: positive / neg...
asked by 23.11.2017 / 21:06
1
answer

"undefined reference" error when compiling in C

I have a simple program where when compiling of an error    undefined reference to 'increment' | main.c : #include <stdio.h> #include "incrementar.h" int main() { printf("Numero incrementado%d!", incrementar(10)); r...
asked by 23.09.2017 / 18:30
1
answer

How to transform pointer into array

I'm doing a program that transforms an array into a transposed array. I'm using 3 functions because I want to learn how to pass parameters from arrays . The main() function calls the mValores function that prompts the user for...
asked by 08.10.2017 / 18:26
1
answer

Function remove threaded list

Algorithm remove_first(L): if L.head is None then Indicate an error: the list is empty. L.head = L.head.next L.size = L.size−1 I was left with doubt about memory leak. Since the removal of nodes seems to work o...
asked by 14.10.2017 / 02:44
3
answers

How do you judge all numbers typed? Only the latter is being tried and displayed

@Edit people can not use vectors only for, while, and while: x I made this code but in the end when and to display the numbers that I typed it is so the last number entered instead of all, what should I fix? Question: A number is, by defin...
asked by 15.10.2017 / 05:25