Questions tagged as 'string'

1
answer

Copying string stored in pointer

What's wrong? #include <stdio.h> #include <string.h> int main(void) { char *str= " teste"; int j = 0; while(str[j] == ' ') j++; memcpy(str, &str[j], strlen(&str[j])+1); printf("%s", str); retur...
asked by 30.04.2016 / 16:49
2
answers

Return string in C for handling outside the function where it was declared

I should develop a calculator that reads strings from the algebraic form of the operation with complex numbers. I need to manipulate the "main" vector outside the function in which it was declared (receives). How to proceed? Should I use pointer...
asked by 26.09.2016 / 06:10
1
answer

How to store letters in a variable and display them all at the end forming a phrase / word

I'm holding programming and am making a code where I must turn a code into binary in a sentence. I'm turning the binary value into decimal, and getting the decimal value and comparing the ASCII table. But I do not know how to save the letters th...
asked by 25.08.2016 / 02:47
1
answer

Format string qt html charset

I have the following string: QString str="Macarr & # x & 3; the integral. (I put space between all characters of the special character if it would not be visible and would appear A with the uncle "ã") and wanted to format it so that it lo...
asked by 11.11.2015 / 00:40
1
answer

How to convert AnsiString to Char in C ++ Builder?

I need to choose a txt file through OpenDialog , to open through fopen . The problem I'm encountering and the conversion. The fopen function has as parameter const char , since opendialog returns the file p...
asked by 21.07.2016 / 21:13
1
answer

How can I abbreviate a name for 2 words, ignoring (of, of, das, das)?

I have a user table in the system where the user's full name is registered. However, at the time of displaying those names on the system, I must use only two words of that person's name to display. And when the words das , dos , d...
asked by 01.10.2015 / 14:29
2
answers

String reading and input buffering

I've always used the fgets () function to read keyboard strings, since it (at least I thought so) always clears the input buffer. However, I'm encountering some errors with running the function in the case of the code below. The strings are not...
asked by 20.09.2015 / 16:33
1
answer

How to get only a part of a string from a pattern?

I have a string in Lua language. I want to get only the filename part through match ( 403.htm.en ). Example: var=[[Content-Disposition: attachment; filename="403.htm.en" Content-Type: text/plain; name='403.htm.en'...
asked by 30.07.2015 / 18:59
1
answer

Is there any way to translate the error messages produced by PHP?

Is there any way to translate error messages in PHP? Example: English    Use of undefined constant X English    Use of undefined constant X     
asked by 03.08.2015 / 18:04
2
answers

preg_replace with Regex to add a tag

Does anyone know how to do regex select the phrase and add a tag? <li> <p>b) texto muito longo;</p> </li> $FechasemClassAlinea = '<p>[a-z])_.*</p>\n</li>$'; $FechacomClassAlinea = '<p>...
asked by 03.05.2015 / 18:58