Questions tagged as 'c'

1
answer

Receive an integer and a string and store it in 2 vectors in C? [closed]

I'm learning C and I'm stuck in an exercise that asks you to store the data as follows. Student Note and Student Name on the same line, and then with a chosen index determine the situation of the student, the part of manipulating the index an...
asked by 17.09.2017 / 16:56
1
answer

How to declare string strings?

Moon is written in C logo shares the American Standard Code for ASCII Information Exchange Accepts array key declaration with accent: rafael = {} rafael["é"]="eu" print(rafael["é"]) --saída: eu But how to do string declaration with...
asked by 16.10.2017 / 03:37
1
answer

How do I create a variable of type char with an indeterminate size [duplicate]

How do I create a variable of type char * (to store a name) with an indeterminate size? Example: char nome[30] = { 0 } // 30 é o valor máximo e no caso se a pessoa tiver um nome grande? que ultrapasse 30? cout << "Informe seu nome c...
asked by 15.10.2017 / 14:37
1
answer

How do I send programming policy of the main program to any library?

I have a library that generates a result of two allowed. This is done by defining, within the library itself, the #define __SE8R01__ or #define __RF24L01P__ directive. The case is that this choice should be made within the main...
asked by 04.09.2017 / 18:15
1
answer

How to print a string from a string vector in C?

I have a string vector ( palavras[x][y] ) , I can read every word that will be an element of the vector, but I can not print any of these stored words. printf("%s",palavras[a][b]), does not work. Here are my attempts: #inc...
asked by 04.10.2017 / 00:02
1
answer

Data does not persist in switch case

Write a program that lists the names, height, weight, cpf, and sex of some people. With the data entered, then locate a person through your CPF and print your BMI. When I choose the Query option, the data that was entered before does not rema...
asked by 04.10.2017 / 04:39
1
answer

Printing binary tree graphically in C

Last week I was working on this code that prints binary tree graphically but I did not quite understand how to use it or if it has a bug because I type the number of nodes and the algorithm keeps processing and does not print. #include <stdi...
asked by 19.09.2017 / 12:36
1
answer

Valgrind in eclipse

I've been looking for a long time and I can not find anything like that. I need to use Valgrind in eclipse (eclipse has support), I already realized all the packages installations that I found on the net but I was not able to run it at all. To r...
asked by 10.08.2017 / 15:39
1
answer

Check if typed string is in e-mail format

Well, I need some help to check if the typed email ends in "@ usp.br". Here is the code I've tried: /* pega o tamanho total do email digitado */ int tamanho = strlen(email); /* a partir do tamanho do email, comece a contar nos ultimos 7 car...
asked by 03.09.2017 / 02:57
1
answer

Program in c showing output, strange different from the value of the variables

I have a problem executing a program in ec and when I compile it and execute it it shows me a value that is not defined in my variable I'm thinking it's some bug with ide or something related to the buffer I'm going to leave a screenshot for you...
asked by 26.08.2017 / 14:39