Questions tagged as 'c'

2
answers

Using functions

Good afternoon! I am implementing a game of stone, paper and scissors, where the application of functions occurs, with and without argument and return. I was in doubt after the program to identify the options of the user and the computer, becaus...
asked by 30.10.2015 / 19:15
1
answer

Function "strstr ()" is not locating what I expect

#include <stdio.h> #include <string.h> char tracks[][80] = { "I left my heart in Harvard Med School", "Newark, Newark - a wonderful town", "Dancing with a Dork", "The girl from Iwo Jima", }; void find_track(char sear...
asked by 04.01.2016 / 21:41
2
answers

Error running .exe file generated by Code :: Blocks

In the bin/debug folder of the Code :: Blocks project, it warns you of this error. How can I fix it? I downloaded the DLL and sent it to system32 , but the error persists.     
asked by 12.01.2016 / 18:58
1
answer

Interpret the JSON response of a WebService that was called by the Arduino

How do I interpret information from a WebService that was called by Arduino? The WebService returns a JSON and needs to interpret it. An example of the answer can be seen below: [{"valor":"10"}] The code below, obtained from this sit...
asked by 02.12.2015 / 14:53
1
answer

Concatenate string with integer vector and write to file?

I have a dynamic integer vector. For example: 1 2 4 6 8 9 10 I want to attach it to a string, like this, for example: [B]: And write this to a file line, then read the file with the following output, for example, assuming the program...
asked by 05.12.2015 / 21:45
2
answers

How do I access the pointer of a struct within the pointer of another struct?

typedef struct vertice { int num_vertice; int profundidade; struct vertice **vertices_adja; } Vertice; typedef struct grafo { int qtd_vertices; int *Vertice; } Grafo; I want to access the attributes of the...
asked by 06.10.2015 / 16:07
1
answer

1st degree equation in C

How can I implement a algorithm that calculates a 1st degree equation in C ? I know that a first-degree equation to be solved must follow three steps:    1 °: Group the numbers on one side of = all terms you have   the incognito (x)...
asked by 10.10.2015 / 04:54
1
answer

Exit the loop as soon as the string name equals 0

#include <iostream> #include <locale.h> #include <stdlib.h> #include <stdio.h> #include <string.h> using namespace std; int main() { setlocale(LC_ALL, "portuguese"); int idade[20]; string nome[20]; ch...
asked by 02.11.2015 / 16:35
3
answers

How to make an integer store a 12-digit number?

I need to find the largest prime factor of the number 600851475143. Because it is a very large number, I can not store it in a variable of the normal integer type. The code I made to find the largest prime factor of a number is this: #in...
asked by 13.09.2015 / 05:59
2
answers

Bit array in c doubt

Galera was looking at a bit array examples and I saw the following function: char get_bit(char *array, int index) { return 1 & (array[index / 8] >> (index % 8)); } I could not understand why the author used >> in...
asked by 09.05.2016 / 02:32