Questions tagged as 'c'

1
answer

Function "strcmp ()" working without adding "string.h"

I wrote an algorithm in C that uses the strcmp() function. Even forgetting to add the string.h algorithm worked. I would like to understand how it worked since I only found this function in the string.h library. #includ...
asked by 19.12.2018 / 20:22
2
answers

How to compile a * .c file with clang so that it signals the problems?

In GCC I typed in the terminal: gcc -wall -o nomedoarquivo.c nomedoexecutavel or if you only had 1 .c file [NOTE: typed "a" to facilitate the executable name]: gcc -wall -o *.c a The restriction I used, if there was in the code the...
asked by 31.01.2014 / 01:00
2
answers

Creating buffers in PHP

Personally I need to create a buffer (string) of a dataset (array) to send via socket. In this buffer I want all the attributes of the set that are stored in it, obey its size. Example: If I am going to store an integer value of the data...
asked by 27.07.2015 / 16:37
2
answers

Compare two strings with C accent

I have the following problem, I need to compare two strings ignoring the accent, for example: Étnico | Brasil Using a normal function of comparison is returned that "Ethnic" comes first that "Brazil" in view...
asked by 11.07.2015 / 18:50
1
answer

Print data from a dynamically allocated two-dimensional array

I would like to know how I can print the information collected in Creator_Matrix using the Print function. This is the code I have made so far: #include <stdio.h> #include <stdlib.h> float **cria_matriz (int lin, int col){ int...
asked by 19.03.2015 / 17:47
1
answer

Creating processes with fork

I'm creating a sequence of processes through the command fork , but when I was listing the processes generated by the code, I came across that there was a larger amount than I had created. Why this?    By 10 forks 1024 proces...
asked by 28.01.2017 / 05:22
1
answer

Segmentation fault when accessing pointer contents

I need to declare a vector of pointers, which will point to types float , and do a simple reading of values. The program compiles but after entering 4 values I get a Segmentation fault (core dumped) . Why does this occur because I'v...
asked by 22.12.2015 / 12:55
1
answer

How to see the value of a define or macro in gdb?

I have the following line of code: int a = MAX(b,c); How to check the definition of the MAX(b,c) macro? Sometimes the same macro is defined in several different ways in a code (for example, depending on the architecture). This would...
asked by 13.02.2015 / 15:27
2
answers

When to use these commands?

What criteria do I use to apply the getch(); , return0; , and system("pause") commands to the end of a program?     
asked by 19.11.2018 / 16:06
1
answer

Binary calculator in C

I have this function that converts decimal to binary, but then how do I sum the bits, or use & (and) .. etc? Use the & do we have to make the count with 2 decimals? Ex: 25 & 25 Or we can do 11001 & 11001 My question...
asked by 22.08.2018 / 23:31