General C++ Programming - February 2016 (Page 20)

Invalid Null Pointer Error help!
 
I have this binary search tree, and I am trying to write this object into a binary file, extension .dat So when basically the user has a menu, and is given a...
[6 replies] Last: What do you mean? my code works perfectly fine *aside from the read f... (by cire)
Trying to dynamically allocate array of structure.
 
#include <iostream> #include<string.h> using namespace std; struct st { string name; long marks; }; int main() { int x; cout<<"E...
[2 replies] Last: Yeah what Tarik said You are inputting as the index every time so y... (by alex067)
Returning std::move() for a local object
 
Hi, According to what I have read, the return value optimisation occurs only when: 1) the type of the local object matches the return type of the function an...
[9 replies] Last: Beautiful answer Cubbi!!! Thanks ! And thanks to all for your valid ... (by JUAN DENT)
Trying to fix this merge sort code
 
Hey all Ive written this merge sort code that uses an array of structures that sorts the data according to the name of the student.Im getting a seg fault here....
[3 replies] Last: $ gdb a.out > run (input) Program received signal SIGSEGV, Segmentati... (by ne555)
Discrete Find all functions from Set A - > B
 
Hi all, I am stuck on this problem and I am at that point where I really could use some help. My task is... Say we have the set A = {1,2} and set B = {a,...
[4 replies] Last: Extreme brute force: #include <iostream> #include <set> #include <uti... (by JLBorges)
Array problem: I have never been so lost.
 
This problem is actually written in Java, but it should still be readable by anyone who has never worked with Java. The problem is as follows: Say that a "clu...
[6 replies] Last: Because any time counted is true, you end up in the else part (line 10... (by dhayden)
by Kubani
Odd errors when creating a Vector
 
Hi to all, The code below is part of a bigger program and it's not complete yet. And the bodies of these functions are deliberately empty: T* allocate(int n...
[2 replies] Last: Thank you very much dear Thomas. (by Kubani)
by sr123
count and position
 
Very new to c++ I was trying to solve one common question but not sure how to proceed. Help will be really appreciated. (I am trying to solve without using inbu...
[4 replies] Last: Hi sr123. This program will need use of strings. I will try to solve t... (by GrShultz)
Error "C4700: uninitialized local variable"
 
Hello people, this is my first time using this site so cut me some slack if I have trouble. I am in currently Foundations and Computer Programming II learning h...
[5 replies] Last: This means that you've selected the wrong kind of project. You're usin... (by Moschops)
Writing object into binary file
 
How do you write a whole object into a binary file? Lets say I have a class X, and this class holds 3 ints and a string, can I write it into the file as an O...
[5 replies] Last: No a std::string is not just a character array (see Chervil's first pa... (by Peter87)
Program keeps crashing
 
Hello everyone, new c++ programmer here and my program keeps crashing when I run it. There are no errors so I'm completely lost. Anyways I'll give you the instr...
[3 replies] Last: There's no need to repeatedly calculate average inside the loop: for ... (by Chervil)
XOR cipher
 
Write yoXOR cipher is an extremely common data encryption algorithm. A basic Wi-Fi security system uses a XOR cipher and a swap algorithm for encryption, the e...
[1 reply] : Stop asking us to do the coding for you. At least show us an attempt y... (by RUNNER PRO AGARIO)
Error referencing to a .dll
 
Good evening to everybody. I am having a problem working with an already made project (.vcxproj file). I am using visual studio, and when I want to debug it,...
[3 replies] Last: You're welcome, glad to help! :) (by RUNNER PRO AGARIO)
by noaboa
Lua scripting tutorial
 
Hi, I know much C++ and I think it is time to take a step further. So I am wondering what whould you recommend doing next? I was thinking to learn Lua as a scri...
[1 reply] : C++ scripting Lua What does this mean? The reference is all you need... (by helios)
Perfecting Knight Movement in Chess
 
So this is what we have reached in this project, which finds the possible moves for a knight. What I am asking here is that could someone find a more simple wa...
[10 replies] Last: Oh, looky, an ongoing thread in the proper forum to debate stylistic d... (by booradley60)
Algorithm to Split a String into an Array by a character
 
Hello. I'm trying to split my GString (my own string class) into a GArray (my own vector class) by a character called Splitter. // THE SPLIT FUNCTION static...
[4 replies] Last: You're right. I set 0 now. Since it's a dynamic array, there'll be no ... (by gedamial)
program for perfect number
 
Hi, I am trying to get the output of the program as the perfect number along with its divisors. I am able to print out the perfect number but not its divisors ...
[no replies]
Is this a correct move constructor?
 
Hi, Say I have a struct Widget that supports moving operations: struct Widget { std::string name; Widget( Widget&& w) : name { std::move( w.name) ...
[1 reply] : What you have written is correct. Note that in this simple case there ... (by Peter87)
enter any integer and convert it to words.
 
So I have been writing a code and I am trying to get it to spell out word by word using the numbers I entered. say I enter '-000000000000026450' I would like to...
[7 replies] Last: this is my new code so far i can get it to print -21 say but i cant pr... (by cboehm7338)
Append c-style string to my String class
 
Hi. I've my GString class that accepts a c style string as parameter: class GString { private: char* mainString; int size; public: ...
[7 replies] Last: Not helpful in anyway, but I like your class name.. (by Pratik K)
February 2016 Pages: 1... 18192021
  Archived months: [jan2016] [mar2016]

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