Questions tagged as 'c'

1
answer

ERN LNK 2019 - How to solve?

I'm having a problem with Visual Studio 2017. This appears when I'm going to compile:    LNK2019 undefined external symbol _WinMain @ 16 referenced in function "int __cdecl invoke_main (void)" (? invoke_main @@ YAHXZ) Win32Project2 Tha...
asked by 25.05.2017 / 02:13
1
answer

Get element size of a vector? [duplicate]

I have a vector like this: int nums[10] + {1235, 14627, 1625161, 54437}; Always the element will be greater than or equal to 1000, that is, with a length equal to 4, and can be extended up to 10 digits. I want to know how I get the...
asked by 08.10.2015 / 05:36
1
answer

C program to solve mathematical expressions using binary tree

I'm trying to build a tree that gets a fully mathematic math expression [ex: ((a + b) + c)], but I think my insert function is wrong! Can someone give me a light? typedef struct arvore { char info; struct arvore*esq; struct arvore*dir; }no;...
asked by 16.10.2015 / 04:47
1
answer

Vector and matrix ordering [closed]

Is there another method for ordering array / array in ascending or descending order without being what I used? (What would you change in this code to make it "better"?) #include <stdio.h> #include <stdlib.h> void ordem (int vetor[...
asked by 25.10.2016 / 16:15
1
answer

C word counter optimized

I'm trying to understand an example of C code to count words (from Programming Pearls). But I am in doubt in some snippets of the code (maybe I have not typed correctly): nodeptr bin[NHASH]; This declares an array of type nodeptr...
asked by 18.01.2017 / 20:23
1
answer

How do I read these warnings

I'm doing a program that hunts a word from within an array. For this I did 8 functions that scan in all regions, as I need to return in the output the coordinates of the first and last letter. For example, I need to find the word "house" in t...
asked by 27.09.2016 / 22:57
3
answers

Exercise with even and odd C

Statement - Make an algorithm that reads a set of numbers (X) and indicates the number of even numbers (QPares) and the number of odd numbers (QImpares) read. Note: Entry of values ends when the user enters 0. #include <stdio.h>...
asked by 22.11.2016 / 16:21
1
answer

What is the problem with my program?

I'm trying to better understand how pointers work in C and C ++ and for this I am trying to make this small list of linked lists (I took the example from the book "Data Structures" of the publisher Cengage Learning). I can not understand why my...
asked by 04.08.2016 / 07:30
2
answers

pointers casting

I can not understand why casting between pointers has some impact on the code, and just to leave the code readable, for example, this line of a function: void* getPhysicalAddress (pdirectory* dir, uint32_t virt) { ... ... return...
asked by 04.08.2016 / 20:26
2
answers

Print amount of nodes in a list

This code below does not work correctly, I type 5 nodes and was to return the number 5 (total number of nodes inserted). It turns out that I get 4. int qtd_no_lista (tipo_lista * recebida) { tipo_lista * aux = recebida; int cont=0; while (...
asked by 18.04.2017 / 19:57