Questions tagged as 'c'

1
answer

Algorithm C. Why does the "why" string return and do not return numeric values?

I wrote an algorithm in C to write on the screen ordered pairs of a function, with input of x integers. int main(int argc, char *argv[]) { int x,i; x = -1; do{ system("cls"); scanf("%i",&x); if(x>10...
asked by 20.08.2017 / 22:31
1
answer

C program to concatenate strings does not execute correctly

include int main(){ void concatenarStrings(char string1[], int t1, char string2[], int t2, char string3[]); char palavra1[]={'p','a','o','c','o','m'}; char palavra2[]={'m','o'...
asked by 21.05.2017 / 23:59
1
answer

Doubt with C pointers

I have a linked list, with a single variable that is the date (int). I made this function to delete by value. lista *head = NULL; void deletar(int valor) { lista *prev, *temp = head; if(temp->data == valor) { head = temp-&...
asked by 23.05.2017 / 18:16
1
answer

Problem inserting elements in a row

I made a function using the concept of static queue to insert an element, however, it is not running when I call it in main. I do not know if the problem is in it, in the main function or in the two rs ... follow insert function: #include<s...
asked by 24.06.2017 / 19:11
2
answers

Passing from struct to function giving error

I am finalizing a phone book and the program compiles almost integer, except in the function with the ordering method for the names. In the following code snippet, the compiler detects an error when I try to play struct to the temporary v...
asked by 05.06.2017 / 21:07
1
answer

Insertion in Tree B with a large numbers C / C ++

I need to build a Tree B that reads the name of the files in a folder and orders them. "Create a repository of images (100 images with 5 of each ex-category: trees, boat, dogs, houses, computers, flowers, cats, people, beach, plantations, etc.)...
asked by 26.04.2017 / 00:20
3
answers

Programming logic question C

I'm learning how to program in C using André Backes' Complete and uncomplicated C language book. You have an exercise that I can not get the answer to. Follow the Statement:    (The exercise has been slightly changed.) Make a program that rea...
asked by 29.04.2017 / 03:25
1
answer

Bubble sort in list

I'm trying to sort a simple linked list, but I'm not getting it, it only changes the first node because the value is smaller, the rest does not change. void ordenar(lista **l) { int tam = tamanho((*l)); lista *prev, *current = (*l)-&g...
asked by 19.04.2017 / 23:39
2
answers

Algorithm to calculate life time in days

I wanted to know how many days I've lived, between the date I was born to this day, including leap years. I'm doing the following, but I do not know how to finish: #include<stdio.h> #include<locale.h> int main(){ setlocale(LC_ALL,...
asked by 29.03.2017 / 17:55
1
answer

How to make a routine in C keep running and not stop until I execute a command?

Good Night, I would like to do a routine in C type like this: Let's say I have a loop that prints the letter 'a' and while I do not type anything it continues printing, however by the time I hit 'c' for example, it starts printing the letter 'c'...
asked by 01.04.2017 / 00:20