Questions tagged as 'c++'

1
answer

Do you have any way to access a position using a string?

Would not I have some way to access a position using a string ? Example: int vetor[1000000]; vetor["abc"]++; I know it's crazy, but ... "abc" = 01100001, 01100010, 01100011, 00000000 (null character), so "abc" should not represent 1633837...
asked by 07.08.2016 / 23:16
1
answer

Is there a way to create a private class in C ++?

I wanted to create a class where it could be accessed in the library I created, how can I declare the class as private and can be called only in the library?     
asked by 17.09.2016 / 00:43
1
answer

Arduino: Bluetooth connection, and data storage

I am a beginner and I have some projects in mind, I would like to know if it is possible to connect the phone to the arduino and to make an application pass some data to some memory connected to the arduino and other device to be able to take th...
asked by 17.09.2016 / 23:48
1
answer

C file manipulation (skip lines)

Hello, I have a problem with skipping lines in a file, I use fgets (), but it always prints the first line of my file. Home I also did some tests, and for some reason, only one iteration occurs and x enters the if with the value of random. Home N...
asked by 10.03.2016 / 21:12
1
answer

C ++ How to remove an element outside the ends of a list

I use the list library and am having trouble removing an element using remove (), or erase (). With push_back () and push_front () it works, but I need to remove elements that are not on the ends .. I want to pass the id of the node I want to...
asked by 03.05.2016 / 15:05
1
answer

Array initialization with empty list "{}" in C ++

From what I've seen, it's possible to initialize a vector with the empty list, in C ++, but not in C, so that all vector elements are 0: int meuVetor[10] = {}; // Todos os elementos 0, em C++ What I learned in this answer from SOEn. Is...
asked by 24.03.2016 / 22:40
1
answer

Exit the loop as soon as the string name equals 0

#include <iostream> #include <locale.h> #include <stdlib.h> #include <stdio.h> #include <string.h> using namespace std; int main() { setlocale(LC_ALL, "portuguese"); int idade[20]; string nome[20]; ch...
asked by 02.11.2015 / 16:35
1
answer

How to deal with the use of getline () in a for (;;)?

I am storing the names of authors of books in a string vector. for(int i = 0; i<qt; i++) { cin >> nome; NOME[i] = nome; } But I want to have the full name, first name and last name, so I...
asked by 04.11.2015 / 14:31
3
answers

How to make an integer store a 12-digit number?

I need to find the largest prime factor of the number 600851475143. Because it is a very large number, I can not store it in a variable of the normal integer type. The code I made to find the largest prime factor of a number is this: #in...
asked by 13.09.2015 / 05:59
1
answer

How to use something similar to BorderLayout in Qt?

I'm doing a project using Qt, and I missed BorderLayout , could anyone tell me if it exists in Qt? if not, does it have any resemblance to it?     
asked by 30.08.2015 / 20:32