Questions tagged as 'c'

1
answer

Compile files in C using OS X

Two months ago I asked a question related to the compilation of multiple files in C, I'm using OS X, but for GNU / Linux it would be the same. My question is how to compile the following three files from the terminal: main.c racional.c racional....
asked by 07.05.2016 / 23:47
1
answer

RegSetValueEx: create a DWORD value with the data type BYTE

On the official Microsoft documentation the function RegSetValueEx of the Windows API is defined as follows: LONG WINAPI RegSetValueEx( _In_ HKEY hKey, _In_opt_ LPCTSTR lpValueName, _Reserved_ DWOR...
asked by 19.05.2016 / 19:30
1
answer

wchar_t does not print letters with accents

I have the following code: int wordsAnalyzer(char* dir){ FILE* doc = fopen(dir,"r"); wchar_t myChar; int count = 0; while((myChar = fgetwc(doc)) != EOF){ putwchar(myChar); } getchar(); return count; } A...
asked by 14.05.2017 / 11:04
2
answers

Segmentation fault C in Dev C ++

I wanted to know if someone could help me with this error in my code. I do not understand why it does not continue after the accountant takes the value of 10. This is my code: #include<stdio.h> #include<windows.h> int main() {...
asked by 18.04.2016 / 00:59
2
answers

Printf returns 0

The file ends.txt has two columns, the first one corresponds to the last ending of a number and the second one to the number of times a finished number has appeared in it. The objective of the program is to show the ending that has appeared more...
asked by 15.10.2018 / 12:28
1
answer

variably modified at file scope - C

Well, this is my code: /****** pru.c ****************************************************/ /** * * @file pru.c * * @brief Programa para comprobar el rendimiento del procesamiento de una * matriz con dos modos de ejecucion diferentes. *...
asked by 01.06.2016 / 11:00
2
answers

Prime / odd and even numbers C [closed]

I want to make a program in C in which you are asked to enter numbers until you enter a "0" or a negative number, when this happens the program should show: How many numbers were entered How many numbers are cousins How many numbers ar...
asked by 02.08.2017 / 19:14
1
answer

invalid conversion from 'char' to 'const char'

When I use the functions strcmp, strlen, strcat or strcpy I always get the same error, the program says the following: Error: invalid conversion from 'char' to 'const char'. Could someone help me? I attach the code and a photo of a pro...
asked by 22.08.2017 / 10:55
2
answers

What is the use of the while (1) in a loop?

Surfing the net and looking for other people's codes, I've seen a 1 or true but I really do not know what the purpose of this is. while(1){ CODIGO AQUI! }     
asked by 01.03.2018 / 23:46
4
answers

problem with the use of C pointers and step by reference

I do not understand why you do not put the asterisk in int end = strlen(str) - 1; , would not it be int end = strlen(*str) - 1; ? void trim(char *str) // Remove whitespace from a string and properly null- terminate it. { int i; int...
asked by 08.03.2018 / 01:10