General C++ Programming - March 2016 (Page 11)

by Bad25
C++ Compliler Problems
 
Hello all together , I had to make a task and have some compiler errors Header #ifndef CTEAMTABLE_H_ #define CTEAMTABLE_H_ #include<iostream> #include...
[9 replies] Last: 'nullptr' was not declared in this scope nullptr is a keyword that w... (by keskiverto)
reading and printing arrays
 
Hello, I am new to c++ and I have to creat a program that Reads in an unknown number of records from a file {prepare your tables to handle a maximum of 50 recor...
[1 reply] : First u have to fill the array named item_number, description and the... (by sylphsang)
I need to convert CString Hex ip address
 
I am relatively new to programming and could use some assistance. I am reading in a CString of c0a85c45 which is an IP address. I need to break it down into ...
[5 replies] Last: I found the same one and it gave issues with char type cast to CString... (by redchem)
by mkb555
Destructor fails when passing as parameter
 
I'm programming a linked list and a trie that allows linked lists to be added into it. I've tested my linked list thoroughly, and the destructor works perfectly...
[2 replies] Last: Ah, you're right! I didn't think of that! (by mkb555)
Cannot control iostream output to using decimal
 
I am doing the following: cout << "max: " << dec << numeric_limits<long long>::max << endl; and it still prints max in hexadecimal (apparently ignoring ...
[2 replies] Last: Yes!!! What a dumb mistake I made!! Very good insight! Thanks so much... (by JUAN DENT)
Counting the number of binary comparisons
 
I have my code here that asks the user to input a four letter word and then takes the word and searches through a txt file of 4030 4 letter words to determine i...
[no replies]
random integer 5x5 grid
 
I have a homework question where it asks for a 5x5 grid that is filled with random integers ranging from 1-10, can you guys give me a hint on where to begin? Am...
[1 reply] : http://www.cplusplus.com/forum/beginner/22286/#msg116627 (by kbw)
Why is default_delete's operator() not declared noexcept?
 
Hi, Since destructors should never throw (are assumed noexcept even if not specified as such), why is operator()(T*p) const from class default...
[2 replies] Last: Since destructors should never throw (are assumed noexcept even if no... (by cire)
How to find extent of a native array inserted in a unique_ptr?
 
Hi, How can I find out the extent of the native array in the following code: std::unique_ptr<std::string > up{ new std::string }; I tried using: auto up...
[2 replies] Last: Good point cire Thanks ! (by JUAN DENT)
How to pass a derived pointer in a virtual function?
 
I'm looking to pass a base object pointer through a virtual function, and in overriden methods of the virtual function, I want them to recognize the derived poi...
[7 replies] Last: You may want to google for double dispatch to see another approach to... (by wh1t3crayon)
How to resolve particular LNK2001 error?
 
In order for our project to compile and link successfully the compiler option 'Treat WChar_t as built in type' has always been set to No. Now we are adding a...
[1 reply] : when compiling main.cpp you are seeing one declaration of .Connect(), ... (by ne555)
Assign a result of a logic operation between Eigen/Dense arrays to a std::vector
 
Hi Friends, I am dealing with <Eigen> library. I can cout<<(PointsSorted.col(0).array()<0)<<endl; The output is: 1 1 1 1 1 0 0 0 0 0 But how can I assign t...
[2 replies] Last: I have tried, but felt hard to read their documentations. I found Ei... (by landlord2017)
dynamic char array size
 
Hi, I want to make char mystring the size of input. Compiler is claiming it can't do this without an explicit number. I don't understand my the formatting is t...
[4 replies] Last: Or as Peter said use std::string instead: #include<iostream> #includ... (by technologist)
make an object move from one space to another in a grid
 
I have a two dimensional grid of spaces. Each space is either empty (unoccupied) or it's occupied by an object. An object gets a random number of moves ,when ...
[1 reply] : I would create a class Grid that encapsulates a two dimensional array ... (by Thomas1965)
Help me with Exceptions and improvement of class
 
Here is my class. Where should I use exceptions or try catch. I am really weak at exceptions Any design suggestion will make me happy too. #include <iostream...
[6 replies] Last: dhayden:...... ajith mk:...... I am coding just for fun for myself.... (by Calcushtag)
how do they make softwares like blender etc?
 
I always wonder how do they make softwares like blender?? How many people are there who work on such projects ??? I am a beginner.
[3 replies] Last: Yes, well, programs like Blender are rather math heavy and employ a lo... (by Duthomhas)
a template confuseness
 
Because there is much code, I will give you a link, you can download it: http://pan.baidu.com/s/1nufhMLb#path=%252F If you download it, you can use CMake ...
[10 replies] Last: Can you trust others? I spend so long time just to transit a virus to... (by TheIdeasMan)
Dangling pointer?
 
I think I have a dangling pointer here, causing SIGSEGV Segmentation Fault crashes (usually appears when the same variable is removed from hash twice because it...
[1 reply] : You don't use pointers. You do use indices. (std::string has members o... (by keskiverto)
How to create a member in the base class after the constructor of the subclass?
 
Hi, Looking at std::enable_shared_from_this<T> , literature says that its method shared_from_this() cannot be called inside the constructor for the subcla...
[2 replies] Last: Thanks! Yes, I think the book was not clear on it, because that's what... (by JUAN DENT)
March 2016 Pages: 1... 910111213... 23
  Archived months: [feb2016] [apr2016]

This is an archived page. To post a new message, go to the current page.