Questions tagged as 'c'

1
answer

Reading a String [closed]

If I have a String that is: String s = "2123dog"; How can I calculate the first character 2 to transform the next 2 characters into an integer, and 4 to transform the name that is dog? The result would be (12, dog)?     
asked by 30.07.2018 / 02:24
1
answer

How to select matrix positions / random draw? [closed]

Good morning! I need to make a random draw from the array elements to find out if there is a boat (boat = 1). Just as at the end of 10 attempts I need to print with (x) the bombed positions successfully, shots on water (-), water (A), ships (N)....
asked by 04.10.2015 / 19:37
1
answer

structs problem

Good, I developed a parking management program, when people to show on the screen all the cars and their characteristics the brand is printed next to the license plate and I do not know why. Can you help me? CODE: #include <stdio.h> #...
asked by 28.02.2017 / 16:52
1
answer

Elaborate a program in C that receives 6 integers and then the program must present the sum of these numbers in the screen, only here

int main() { int N1, N2, N3; printf("Digite o primeiro numero: ", N1); scanf("%d", &N1); printf("Digite o segundo numero: ", N2); scanf("%d", &N2); printf("Digite o terceiro numero: ", N3); scanf("%d", &N3...
asked by 10.06.2018 / 15:35
1
answer

How to change the color of a console line in C?

So I would like to know how I can change the color of this line ... It's a college project and I've already researched other forums and everything, but I can never find an answer that will work. I am using the DevC ++ (5.11) compiler. When I s...
asked by 06.11.2018 / 16:22
1
answer

Bug in C Counter - Syntax problem [closed]

Well, I was doing some basic programming exercises and I came across a bug that I did not understand very well: #include <stdio.h> #include <stdlib.h> //Program prints the odd numbers until a determined limit. int main() { i...
asked by 04.01.2018 / 13:48
1
answer

Typing error [closed]

I took a C book to study, however, it is a bit outdated, and I came across the following code: #include<stdio.h> is_in(char *s, char c); void main(void){ is_in("olac", "ola"); } is_in(char *s, char c){ while(*s) if(*s == c...
asked by 15.03.2017 / 11:58
1
answer

Make a function that receives a matrix A (10,10) and returns a vector with the sum of each of the lines of A

I'm trying to solve this problem. #include <stdio.h> /* 5. Faça uma função que receba uma matriz A(10,10) e retorna um vetor com a soma de cada uma das linhas de A. */ int matriz[3][3]; void soma() { int i, j; int so...
asked by 15.06.2016 / 00:55
1
answer

Why do not you want to increase?

I want to increment the cont variable if the character vector is not null, understand? But nothing happens. Because? #include <stdio.h> #include <stdlib.h> #include <string.h> void main(){ int i; char testeNome[190]; int c...
asked by 21.04.2016 / 01:35
1
answer

How to translate a program in C to Assembly? [closed]

How do I make the interaction between the two languages?     
asked by 28.01.2016 / 14:24