Questions tagged as 'string'

1
answer

Convert a string to char in c ++

I have this structure and I need that in the name field I can enter a data, but I have that data in a string. typedef struct cliente{ int cedula; int numCuenta; char nombre[100]; cliente *izq, *der; }cliente;     
asked by 27.02.2017 / 16:55
2
answers

how to make a triangle with this symbol in python (*)?

1) My first problem is how to apply the math with the symbol (*) in str form. 2) My second problem is how do I make a triangle like this * ** *** **** ***** This is my code so far def triangulo(): simbolo='*' for i in range...
asked by 05.10.2018 / 06:14
1
answer

Constructor with member variable?

I have a question about the following main #include "Pokemon.h" int main() { Pokemon piplup("Piplup", Pokemon::Agua); piplup.mostrar(); cout << endl << endl; } I must say that the main is a reference that the teacher passed us...
asked by 11.11.2018 / 01:03
3
answers

How to convert string to char *?

I wanted to ask about how to convert a string to a char *, the case is the one shown below, where I have a defined string and I want to name the variable x using .setName (), but it receives a char *, so that I can not simply place variable name...
asked by 13.11.2018 / 18:32
1
answer

line breaks in popen with c ++

I am working on a project where I have to execute a command and print the output. Use popen, and it serves, but the output does not show the line breaks, if not, it shows everything as a single line. My code: #include <iostream> #incl...
asked by 06.09.2018 / 18:22
1
answer

Delete the characters in two strings if the character matches the string

I have a problem with Java and it is as follows: I have these two String : String string1 = "aabcdef"; String string2 = "abcghi"; And I need to get this "adefghi" . public static String regenerate(String a, String b) { S...
asked by 28.03.2018 / 22:02
2
answers

Extract 4 random Strings from an Array in JavaScript

How could I extract 4 strings randomly from an array, for example this var myArray = ["Rufles Original", "Aceitunas", "Lays al punto de sal", "Doritos TexMex", "Nachos", "Aceituna maceradas", "Rufles Jamon Jamon", "Cerveza", "Coca-...
asked by 07.09.2016 / 13:16
1
answer

How can I compare the output of a type () function with a string?

If I have a python script like this: texto = "TEXTO" cadena = "<type 'str'>" salida = type(texto) if(cadena == salida): print("Es un string") else: print("No es un string") I think in theory it's fine because you're comparing...
asked by 11.11.2017 / 16:46
2
answers

C: how to assign char * to const char * const *

A function returns a certain number of strings ( uint_32 extensions_count ) and I have to assign each of them in const char* const* extensions . The chains are in this structure: typedef struct VkExtensionProperties { char...
asked by 01.08.2017 / 16:18
1
answer

How can I copy the ASCII value to an int in C?

For example, having the following code my intention is to operate to obtain an index number #include <stdio.h> #include <string.h> int main(void) { char mes[2]= {"02"}; int numero; numero = (int)mes; char *strings[]={ "Ene",...
asked by 22.10.2017 / 06:19