Questions tagged as 'c'

1
answer

How to customize the size of a window?

How can I customize the size of a window I made using win32? My Code: #include <windows.h> int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow){ MessageBox(NULL, "HELLO WORLD!","JANELA!", 0)...
asked by 29.07.2016 / 14:18
1
answer

Error in removing element from a list chained in c

The retiraLifo function is not working and there is some syntax error, but I have not found it. This function is to remove element from the list. insereLifo is working. The following error occurs:    C: \ Users [Warning] pas...
asked by 29.10.2016 / 03:42
1
answer

Pass vector by reference or value?

I want to create two functions, one is to fill a vector with random numbers. The other function is to display the contents of the filled vector. So I did this: #include <stdio.h> #include <stdlib.h> int vetor[5]; void inicia(int v...
asked by 28.12.2016 / 15:35
1
answer

Get the current date directly from the machine

I need to implement the functionality of getting the date directly from the machine in my project (library system). I wanted it in the format dia/mês/ano , to generate the fine for book delivery delay automatically, however, I can only get...
asked by 16.10.2016 / 15:51
1
answer

Copying string stored in pointer

What's wrong? #include <stdio.h> #include <string.h> int main(void) { char *str= " teste"; int j = 0; while(str[j] == ' ') j++; memcpy(str, &str[j], strlen(&str[j])+1); printf("%s", str); retur...
asked by 30.04.2016 / 16:49
2
answers

Return string in C for handling outside the function where it was declared

I should develop a calculator that reads strings from the algebraic form of the operation with complex numbers. I need to manipulate the "main" vector outside the function in which it was declared (receives). How to proceed? Should I use pointer...
asked by 26.09.2016 / 06:10
1
answer

How to store letters in a variable and display them all at the end forming a phrase / word

I'm holding programming and am making a code where I must turn a code into binary in a sentence. I'm turning the binary value into decimal, and getting the decimal value and comparing the ASCII table. But I do not know how to save the letters th...
asked by 25.08.2016 / 02:47
1
answer

Assigning / Printing values to void * in a structure

#include <stdio.h> typedef struct elem{ void * d; }Elem; main(){ Elem *p; Elem e; double pi = 3.14; e.d = &pi; p->d = &pi; printf("%f\n",p->d); printf("%f\n",e.d); } When I do the...
asked by 28.01.2016 / 20:40
1
answer

Parser identifying tokens in the wrong way (Flex and Bison)

I am implementing a compiler based on the Tiger language proposed by Andrew Appel's book "Modern Compiler Implementation in C". Link: link I'm using the available files on the book's website, but when I run the parser, the tokens reported i...
asked by 17.02.2016 / 21:05
3
answers

Sequence reading of numbers separated by space

It is necessary to read only one line with a set of integers separated by space, each item separated by space will be inserted in a linked list: 1 41 2 15 6 7 87 4 2 1 9 0 List would be something like = [1, 41, 2, 15, 6, 7, 87, 4, 2, 1...
asked by 03.09.2016 / 18:13