Questions tagged as 'c++'

1
answer

How to implement a copy constructor for a two-dimensional array in C ++?

I have the following situation: a Matriz class implemented as follows: Header: #ifndef MATRIZ_H #define MATRIZ_H class Matriz { public: Matriz(unsigned int nL, unsigned int nC); ~Matriz(); Matriz& ope...
asked by 29.09.2017 / 17:30
1
answer

Socket operation on non-socket

I'm learning how to program sockets but I'm having problems when I want to exchange the messages between the client and the server, the two codes work as "should", but the problem is when sending a message and receive. client.cpp #include &...
asked by 01.10.2017 / 19:33
1
answer

C ++ string protection using MySQL Connector

I did a program to check my database, and I wanted to see if the strings were protected (user password and database) and in case they are not. I decompiled the program using IDA PRO and found that the strings and information is not protected....
asked by 21.01.2018 / 23:57
1
answer

How do I fix "undefined reference to 'function' in C?

Here is a simple example of TAD, which displays the error. file.h #include <stdio.h> #include <stdlib.h> int teste(); file.c #include "arquivo.h" int teste() { int a=5, b=10; return a+b; } main.c #include "a...
asked by 29.11.2017 / 16:34
2
answers

How to read a string with C ++ space inside a function

I'm in the second half of S.I and sorry if it's a trivial mistake. I need to read a name and surname, for a calendar, I'm using function and I've already tried Getline, cin.get (variable, size), but none works, here's the code below, what I need...
asked by 16.11.2017 / 14:31
1
answer

Passing objects by reference c ++

Speak, I'm trying to learn a little bit of C ++ and I have a question regarding the passing of objects to a class and manipulating it within it. I can do this in C #, but I'm trying in C ++ without having much success. Example: c # class Fo...
asked by 11.11.2017 / 01:43
2
answers

Save file data to a c ++ map

I can not read a txt file correctly and transfer it to a map in c ++. The code I've developed works only if it has no "" spaces in the txt, if it has looped and does not work. Here is the code: void dados::pesquisarProdutos(){ arq.open("pr...
asked by 28.08.2017 / 02:59
1
answer

undefined reference to 'dlopen'

I'm trying to load a .so file, but this title error is showing up. Can anyone help me? #include <iostream> #include <dlfcn.h> #include <stdio.h> using namespace std; int main() { void *a...
asked by 18.09.2017 / 22:07
2
answers

What is the best method to access a member of a class?

What is the best method to access a member of a class in terms of speed and organization? class cMinhaClasse { public: void Funcao(int r); }; int main() { // Método 1 - Acessando classe por ponteiro cMinhaClasse *mClasse = new cMi...
asked by 22.09.2017 / 18:55
2
answers

Assign one class to another in C ++

There is a class like below: class vetor { protected: int x, y; public: //Construtor vetor(int _x=0, int _y=0); }; and another: class pos : public vetor { public: //Construtor pos(); umaFuncaoQualquer(int _x=0, i...
asked by 03.07.2017 / 07:06