Questions tagged as 'c'

2
answers

Is it necessary to invoke the "ShowWindow" and "UpdateWindow" functions?

Recently I did an introduction to the Windows API and I'm already in the part of creating windows. In one of the first applications I created I had use of ShowWindow and UpdateWindow after creating a window, but even without them t...
asked by 27.06.2015 / 00:10
1
answer

What function does it allow to open .txt file and run other functions in the contents of this .txt?

What function in C language does it allow to open file .txt and run other functions in the contents of this .txt ?     
asked by 21.11.2018 / 20:37
1
answer

How do I pass the address of the first char of a string to a function write to it?

The problem is this: I made a function that takes the output of a certain command from the OS and stores it in a string. The idea would now be to declare a string of just one char in my main function using malloc , call my function by pass...
asked by 21.06.2018 / 01:24
2
answers

Output error - C language

Good afternoon, Currently studying Language C and I am faced with a situation that has stuck in the progress of studies, I have made a structure that receives registration and address. The compiler does not report errors, but when it behaves...
asked by 03.06.2018 / 22:46
1
answer

Get size of a vector of characters?

Vector example: char nome[10] = {'b', 'r', 'a', 's', 'i','l'}; First of all, although my vector is 10, I'm only using six, and I want to know how I get this length, which in the case would be 6. In summary how do I get the number of c...
asked by 08.10.2015 / 05:41
4
answers

Error in code, C

I've created an extremely simple code just to test Code::Blocks , but no matter what I do, it always returns the following error: collect2.exe: error: ld returned 1 exit status I still do not understand what I'm missing. the code goes...
asked by 21.07.2014 / 01:27
2
answers

How to receive a keyboard pointer in C / C ++?

How do I get a pointer to char via keyboard?     
asked by 17.10.2014 / 18:32
2
answers

CPF data in a C struct

Hello. I'm having a problem reading data from a CPF. I tried using int, long int or even a char vector [12]. With char I keep the CPF's containing '0' at startup, and with int or long int it does not return correct due to size. I need to sort wi...
asked by 21.06.2014 / 18:37
3
answers

Error in fgets function

The program gives segmentation fault (core dump) when executing the fgets function. Any ideas? #include <stdio.h> #include <stdlib.h> #include <string.h> main (int argc, char **argv) { FILE *fp=NULL; char *f_name;...
asked by 16.05.2014 / 00:37
2
answers

What is the difference between memcpy and snprintf?

I'm seeing people using snprintf when I would use memcpy. I even did some testing and it worked with memcpy. Now I was in doubt why use one and not the other. And what is the real meaning of the two.     
asked by 19.06.2018 / 15:48