Questions tagged as 'string'

2
answers

I can not save the string

void ex51(char *nome_ficheiro){//escrever e criar um ficheiro novo. char frase[100]; printf("Introduza o texto que quer escrever neste ficheiro:\n"); scanf("%s",frase); FILE *fp=fopen(nome_ficheiro,"w"); if(fp==NULL){ printf("Er...
asked by 27.12.2016 / 15:21
1
answer

Why are the characters in the string being printed as integers?

I have to parse an excerpt of code and explain its operation, but I can not figure out the output: Code: word_norm = 'mundo'.encode("utf8").lower() for idx, value in enumerate(word_norm): print(idx, value); Output 0 109 1 117 2 11...
asked by 31.01.2018 / 22:03
4
answers

How to get the last word of a string in PHP?

For example: "JOHN FULANO DE TAL". I just want to get the word "TAL".     
asked by 08.08.2018 / 00:40
3
answers

Convert Double to Integer

I'd like the value of "trees to reset" to appear with no point, nor zeros. In the situation below appears "180.0000000" and should appear "180". It is of type TextView , and would like it to appear in the Integer type. I have already tried...
asked by 12.10.2018 / 04:27
1
answer

How to pick specific letters from a string - Swift2

How do I get a letra specified from a variable? var variavel = "teste"; I'd like to get a letra separada , I need to put each letter in a different variable Thank you!     
asked by 22.01.2016 / 18:34
2
answers

Regex | Catch separate group [closed]

This tag repeats changing the content and would like to know if you can get each content separately TextBox TXTTESTE = new TextBox(); TextBox TXTTESTEDOIS = new TextBox(); TextBox TXTTESTETRES = new TextBox(); ListBox LBTESTE =...
asked by 15.04.2014 / 22:29
1
answer

Extract existing value between two tags with regular expression

How to check from a regular expression if there is a certain value between two strings, for example, the tags <code> and </code> ? I want, for example, to know if there is a value between "03" between the two tags. Ho...
asked by 17.03.2016 / 19:53
1
answer

Reading char and string in c ++

I have to put an integer, a real, a character and a sentence containing spaces up to 100 characters. I tried to make the solution but I can only type the numbers and the character and the string are not coming out. #include<iostream> #in...
asked by 06.09.2018 / 20:14
1
answer

Comparison of elements of a vector with stcmp

In the following function I want to compare the elements of an array of 1000, but I can not find a way to compare them successfully, even using strcmp() . void verifica_conta(int *ptr) { int i; //Posição for(i = 0; i < 1000;...
asked by 01.11.2017 / 04:43
3
answers

Conditional sex selector if

How would you do in this code to get the person's gender and display in printf() ? I've seen a lot of activities in the condition of if , if you used too many numbers and hit me a question: What if it was with letters? #inclu...
asked by 12.07.2018 / 01:36