Questions tagged as 'char'

1
answer

C / C ++ - Error comparing char with strcmp ()

I need help, I'm having trouble comparing two variables using strcmp (). [Error] invalid conversion from 'char' to 'const char *' [-fpermissive] struct transicao{ int estado; //estado em que o DFA esta char simbolo; //simbol...
asked by 12.09.2014 / 16:37
0
answers

Difficulty in doing Foreign key with two char fields in Mysql

I am not able to create a foreign key between two tables, whose type is CHAR : ALTER TABLE hardware ADD CONSTRAINT fk_INC_LOCALIDADE FOREIGN KEY ( INC_LOCALIDADE ) REFERENCES localidade (INC); The error is:    ALTER TABLE hardware...
asked by 11.12.2018 / 12:05
0
answers

Read entry and store specific information in C

I want to identify all 32 reserved words of C written in an entry that simulates a C code, but it is not storing all and I do not know what is wrong, obs stores only if it appears and what not the number of times it appears. Here is the code and...
asked by 08.11.2018 / 21:55
4
answers

How to convert a char to an integer?

Converting a string to an integer with the atoi() function is easy, is not it? However, when I use the atoi() function to convert a character to an integer, the program that is at runtime simply crashes. What would be...
asked by 01.04.2018 / 23:53
1
answer

char and constructors in c ++

I need a constructor for a class that has char vectors as attributes, like this: class Anthem { private: int Id; char Name[50]; char Country[50]; int Year; char Composer[30]; char Historic[20...
asked by 30.05.2018 / 20:04
1
answer

How to get a char data from JOptionPane?

char cadastrar; cadastrar = JOptionPane.showInputDialog("cadastrar: A-aluno P-professor M-medico");     
asked by 23.05.2018 / 22:28
1
answer

Character search function

I am trying to write a function that returns the index of the character. For example, I want to fetch the 'a' index the fifth time it appears in the text. This is my code: int buscaChar (String text, char c, int n) { int index=0; int co...
asked by 16.02.2018 / 18:19
1
answer

Change an array of char within a function

I'm trying to pass a char array pointer to a function. I want it to make changes to this char array. Here is the code for the function: void dhnfe( char tzd, char hverao, char *dh) { if (hverao == 1) { switdh(tzd) {...
asked by 24.06.2017 / 20:45
1
answer

Copying strings in C [duplicate]

I'd like some help on the following question: I have a char with a text of 32 characters, so I would like to know how to separate this char into two of 16 characters. Type: char textao[32] = "Oi meu nome e Cesar tudo bem...
asked by 25.05.2017 / 02:30
1
answer

ASCII value for char or Int value for ASCII C

I need to find a value found by a rand in a file, I'm having a lot of problems because rand returns an integer and to search for a character in a file, the fgetc returns an integer corresponding to the ASCII of the character...
asked by 02.11.2015 / 20:30