Questions tagged as 'char'

1
answer

Stack of characters

Good night people, okay? I'm with my program here from RPN Calculator and apparently everything is working normal despite great difficulties to work with char stack. I'm missing implementing the power function on my calculator only, but nothing w...
asked by 20.10.2016 / 02:43
1
answer

Help: Valuing a char array of a struct within an if

I'm trying to set the value of a char vector of a struct inside an if, but without success ... A struct itself: struct ficha { char nome[31], classificacao[31], telefone[21]; float altura, peso, imc; }paciente1, pa...
asked by 15.07.2014 / 23:36
1
answer

Problem with char * and fgets ()

I have struct with a field of type vector of char and I have a file .txt with several lines in this format with names of songs.    text1 text2 text3 text4 I need to read the entire file line by line and store each...
asked by 20.06.2014 / 06:29
1
answer

Vector of struct and pointer to char

Why this syntax is wrong: #include <stdio.h> typedef struct { char* nome; char* numero; }Agenda; void adiciona(Agenda* reg, int i) { scanf("%s", reg[i]->nome); scanf("%s", reg[i]->numero); } void imprime(Agenda*...
asked by 03.06.2017 / 00:22
1
answer

Using Unicode in a variable char

How do I use unicode in C ? I just do not know how to store the 2 bytes of a unicode in a char, only this, does anyone know how?     
asked by 28.10.2015 / 03:57
1
answer

Read char array from a binary file

Function that writes and reads the binary file: int FUNCAO_QUE_GRAVA_BIN (char filename[],int partida1,char resultado1) { typedef struct { int partida; char jogvelha[3][3]; char resultad...
asked by 27.11.2018 / 12:20
2
answers

Function that returns next character in ASCII table in PHP

I would like to make a function in PHP that takes a character and returns the next character, according to the ASCII table. For example: get 'a' and return 'b'. I know how to do this in C, which would be char funcao(char C) { return C++;...
asked by 13.02.2018 / 00:39
2
answers

detect char repeated in string c ++

Hello, I am trying to make a code to detect the occurrence of parentheses Na(CO5(Pt Let's assume something like that, I would have to detect the position of the two parentheses that are in the string. I tried to use string.find but it al...
asked by 14.12.2017 / 03:33
2
answers

Doubt char char C

Hello. I need to make a pointer char point to a memory location that holds a phrase, in C. I'm doing this: char *ptr; char array[3] = {'o','l','a'}; ptr = &array; But I do not understand what's wrong, I also do not know how to...
asked by 09.10.2017 / 22:55
1
answer

Converting vector from char to string - C ++

#include <iostream> #include <string> #include <vector> using namespace std; int main () { string vet[10], aux; std::vector<char> name; int count=0, sum=0; while (count<10) { getline(cin, aux...
asked by 22.02.2016 / 14:49