Questions tagged as 'char'

3
answers

Arrays not started in C

How do I know how much size I should put to go through an uninitialized array []? For example in that with char []. #include <stdio.h> #include <stdlib.h> int main() { char texto[] = "Linguagem C."; /* for(int i=0; i<13;...
asked by 17.05.2015 / 04:09
2
answers

Targeting failure (recorded core image)

I'm doing a program for a simple purpose: Take a phrase and turn it into a version of it with the characters of each word isolated to the contrary, like: "I'm in trouble" would turn "uotsE moc samelborp". When compiling with gcc questao1.c -o q1...
asked by 25.09.2017 / 04:24
1
answer

Insert character by character of Russian alphabet into a char vector in C ++

Hello, I would like to know how to insert characters (from the manual form) of the Russian alphabet into a char vector, since I am trying to write the below and the problems in the printout. Here is the code: #include <iostream> int main...
asked by 14.08.2017 / 23:27
2
answers

How to omit char array size in function?

I came up with a question now, I have a function implemented this way: mostrarMensagem(char msg[10]) { //aqui faço algo com a variável "msg". } But I do not know the size that I will receive as the actual parameter, if it is greater than 10...
asked by 29.06.2017 / 06:17
1
answer

Sort vector of Char in C using selection method

I'm trying to sort a vector of char using the selection method (Seletion Sort), but it's returning the vector exactly the same, without even making a change. Can someone point me to where the error is in the code? void selectionSortChar(char v...
asked by 20.03.2015 / 01:37
2
answers

Size of a vector of characters according to their addressing

Is the size of a character vector given by its address or variable value? Example: char[1000] = "Exemplo Teste" Is the length of this variable 1KB due to its char[1000] address or its size is 13 because of its content?     
asked by 26.12.2018 / 21:40
1
answer

Comparison of char variables

I'm developing a program that needs to read a variable in char and compare it with another char . However, when performing comparisons using the strcmp(typed_pass, correct_pass) function, regardless of the text obtained throu...
asked by 17.05.2017 / 03:51
1
answer

Pointer return that points to a local character vector?

#include <stdio.h> char *local(void); void main(void) { char *ponteiro = local(); printf("%s\n", ponteiro); /*Saida = - (*/ } char *local(void) { char nome[12] = "programador"; char *ponteiro = nome; return ponteiro;...
asked by 09.05.2018 / 05:29
1
answer

Function receives as parameter a vector of strings

I started learning the C programming language a little while ago and I'm having a hard time. I declare a vector of strings, step values for that vector, and then pass that same vector as an argument to a function. The problem is here, when I...
asked by 03.12.2017 / 00:45
1
answer

system () function does not accept string variable in c ++

In order to automate some backups that need to be done routinely, then I thought of using an app in dos to do, however I'm having problems compiling the executable because it seems to me that the function system() only accepts cha...
asked by 10.05.2017 / 20:34