Questions tagged as 'c'

2
answers

Undefined infinite loop no while

I made a program to calculate within a sequence the sum of the positive numbers and the sum of the negative numbers. When I use the command while , the idea is to be within a sequence of 7 numbers, and then the program exits from while...
asked by 05.10.2017 / 03:59
1
answer

Increment and decrease do not work in expected order

int main(){ int i=5; printf("%d%d%d%d%d",i++,i--,++i,--i,i); }    Output: 45555 Why this output? I did not understand the reason for this exit correctly.     
asked by 12.12.2017 / 18:36
1
answer

Problem with malloc in C when creating string concatenation function

char *ft_concat_params(int argc, char **argv) { int index; int aux2; char **newString = argv; aux2 = 0; while (argv[aux2] != 'char *ft_concat_params(int argc, char **argv) { int index; int aux2; char **newString...
asked by 03.11.2017 / 05:39
1
answer

Break string with multiple symbols

I have a string in the following format:    0: name: password: email: etc I need to separate it in each ':', and I'm doing this with the strtok function (string, ':'). The problem is that the password can be null, and the default looks...
asked by 06.12.2017 / 13:36
1
answer

How to remove duplicate elements from a list in C?

I have a list of contacts and need to remove duplicates, I was trying to solve using the code below: Elemento* remove_duplicados(Elemento* agenda) { Elemento* a = NULL; //POnteiro do Elemento anterior Elemento* p; Elemento* q;...
asked by 30.11.2017 / 18:55
1
answer

Problem with linked list of dynamic implementation in C

Hello, guys, I have two questions: Why am I unable to print any list? How do I go through a given list, headless and without sentinel, backwards, using this implementation? #include <stdio.h> #include <stdlib.h> #include...
asked by 02.09.2017 / 16:45
1
answer

Error generating calendar in C

I was fiddling with a program that generates a calendar for a month but it is not working correctly with bisexual years since in March 1004 the first day begins Wednesday and the last Friday. March 1004 Sun Mon Tue Wed Thu Fri Sat...
asked by 07.09.2017 / 23:54
1
answer

typedef struct syntax

What is the difference between writing typedef struct "nome1"{}"NOME2"; , as implemented in a linked list; and typedef struct{}"NOME1"; , as implemented in the sequential list I've seen. I've also come across struct "nome1"{}ty...
asked by 19.08.2017 / 00:04
1
answer

Presentation failing in binary tree

   I can not display my tree in either order or preorder as in the example below the cursor just goes out and expects another statement #include <stdio.h> #include <conio.h> #include <stdlib.h> typedef struct tipoNo{ in...
asked by 23.08.2017 / 23:07
1
answer

Problems Reading File in C - comma delimiter

Help kindly. I have the following file line structure: 99933311133,UM NOME QUALQUER,8485885855,UM ENDERECO QUALQUER,84 9992212,S,S The default is: string-comma-string-comma-string-comma-string-comma ... That is, each field is separated b...
asked by 07.11.2017 / 23:22