Questions tagged as 'c'

1
answer

Good practices in C on "main ()" call?

I'm developing a simple application for college work, and I'm hesitant to use the main() function in code so instead of going back to the beginning of the program, would that be a good practice or not? Below I have an example in my fun...
asked by 01.07.2018 / 21:37
2
answers

How to validate an email in c

Hey guys. I need to do an e-mail scan with these features. Email must have: 3 characters or more; an at sign ("); other 3 characters or more; followed by an endpoint (.) signal; and a set of at least 2 characters. What I did was this, but...
asked by 27.06.2018 / 04:28
1
answer

Stone-paper-scissors-lizard-Spock on Uri Online Judge ex. 1873, but he does not accept

My attempt: #include <stdio.h> #include <string.h> int main() { char rajesh[15], sheldon[15]; char pedra[] = "pedra", papel[] = "papel", tesoura[] = "tesoura", lagarto[] = "lagarto", spock[] = "spock"; int c, i, comp; p...
asked by 27.06.2018 / 00:59
1
answer

How to change a name of a string

I am making a question in uri tag replacement , which has to be replaced one name for another but I'm not having success, I can only get normal names with no characters My code #include <stdio.h> #include <stdlib.h> #include &l...
asked by 12.06.2018 / 18:34
1
answer

Needing Help on Vector Exercises in C

Why are not you displaying the 15 numbers? And how do you include 3 numbers at the beginning of this vector? int main() { int v[30]; int i,x; for(i=0; i < 15; i++) { printf("Digite 15 numeros"); scanf("%d", &...
asked by 12.06.2018 / 02:12
2
answers

Program with Warning and does not accomplish what was requested

Good evening! When I was studying for the test I will do, I faced this question. However, when the program was done, it had a warning and did not perform what I did. I would like you to see my code in order to better understand my error. Thanks...
asked by 31.05.2018 / 23:43
1
answer

entire printf% s in C [duplicate]

I'm trying to get all the characters in the string to appear on the screen [0], but only the last letter of the string is coming out, does anyone help me with what I'm missing? #include <stdio.h> #include <stdlib.h> #include <...
asked by 29.05.2018 / 23:36
1
answer

help defining char within if in C

Hello, I'm trying to set the char variable filename [100] inside the if, but the error in the compiler, but if I set it outside the if it works fine, any help pls? (#defines are stdio.h stdlib.h time.h and locale.h) void selecionarPersonagem(in...
asked by 30.05.2018 / 02:15
1
answer

Invalid operators in a binary expression C

I have here a problem I am trying to calculate the average in my vector class_points , but it gives me an error and I do not know how to solve. Could someone give me some ideas? int better_than_average(int class_points[], int class_size,...
asked by 28.05.2018 / 21:48
3
answers

Struct Strings Read with scanf Giving Wrong

Good luck, I'm developing a C code that performs data registration on files. However, I have a problem with the registerCustom function, which you will see below between the codes. Client struct: typedef struct { int idCliente;...
asked by 29.05.2018 / 02:10