General C++ Programming (Page 5)

by cmisip
const_cast question
 
In the following code, does the constness of myint a get preserved? #include <cstdlib> #include <...
[6 replies] Last: I see. I will have to try this. Making vect() a const function would... (by cmisip)
Adding border
 
So I'm trying to add a border around my menu. Someone told me to try using screenloc() and box(). Ho...
[6 replies] Last: For simple jobs it's often easier to hardcode the menu as follows; #... (by kemort)
by Kalcor
A way to make infix > postfix with more than 1 char/digit
 
So I implemented a stack, that should turn an infix to postfix but sadly, I can't get it to work for...
[2 replies] Last: @kbw Ah I'll try that, thanks! (by Kalcor)
by Kalcor
Parentheses checker logical error
 
This below, is an implementation of stack method for parentheses checker, this code works extremely ...
[2 replies] Last: if(s == ')'){ if(checker.top_element(top) == '('... (by ne555)
Searching 2D array
 
I am attempting to search for a string value in a 2D array based upon an inputted username. This cod...
[6 replies] Last: #include <iostream> #include <fstream> #include <iomanip> #include <s... (by doublemirchi16)
An imaginary lock mechanism.
 
Here comes our scenario. Simply, Bob and Alice are a write and a reader. Bob writes things and Alice...
[4 replies] Last: Thank you Cubbi, Seqlock is the answer. (by nemonemo)
by Kalcor
Is this a correct use of delete?
 
Did I use delete correctly in this code snippet? void pop(Stack *&top){ if(top == nullptr...
[5 replies] Last: Your delete is fine (with the above assumptions from @Peter87), but yo... (by doug4)
by cmisip
std::vector and mmapped memory with two processes
 
I am working on a project where (If I understand correctly ), two separate processes are communicati...
[4 replies] Last: I did try the code. I am getting the correct size of the vector by r... (by cmisip)
Functions not working
 
So I got the first function, is digit to work, but not the others. I'm confused because I used them ...
[1 reply] : Return Value A value different from zero (i.e., true) if indeed c ... (by integralfx)
Need some help with arrays and functions
 
Hi(sorry for bad english), I have some trouble with this i'm supposed to create 4 functions 1st pri...
[1 reply] : Please, always use codetags (the <> formatting button) when posting co... (by chicofeo)
by Kalcor
Linked list question
 
So I was implementing a function that adds data to the tail of the linked list so I tried 2 things o...
[3 replies] Last: `head' is a pointer, so you must be assigning a memory address. `temp'... (by ne555)
by Kalcor
XOR Swap algorithm weird error?
 
I was implementing a quick sort on some array but I encountered this weird error: int part(int a...
[3 replies] Last: xor swap is also slower usually. The cpu has to do the xor AND the sa... (by jonnin)
by Disch
(Templates) Variable args
 
Hey all. Long time no see. Sadly I don't have the time to keep up with these forums like I used to...
[2 replies] Last: Perfect. Thanks JLBorges. Yes I know to use make_unique. I was just... (by Disch)
Strings in C++
 
I use Dev-C++ which has GCC 4.9.2 C++ compiler. I am confused on where and where not to use the fol...
[3 replies] Last: [quote=abhinav mathur]1. include <string> only 2. include <string.h> o... (by Enoizat)
by Kalcor
Is it possible to return an array?
 
Is it possible to create an array within a function and return it at the end of the function ? Also...
[4 replies] Last: > Is it possible to create an array within a function and return it at... (by JLBorges)
by Kalcor
What does this expression mean
 
Sorry for posting for such a short question but what does this int *&s1 mean?
[3 replies] Last: Do you have Google? Perhaps wiki ? (by TheIdeasMan)
Runtime error: Process terminated with status 255
 
I am trying to find the 10001st prime number. It shows runtime error. #include<iostream> using na...
[6 replies] Last: @ne555 yeah! it was because of array size being too small. (by carleye)
Difficulty with Abstract class
 
In my program given below: #include <iostream> #include <ostream> using namespace std; enum ...
[2 replies] Last: [quote=napada99]I'm getting a garbage value for Month m What do you p... (by Enoizat)
Help solving Rate and Hours Problem
 
Create a C++ program to calculate and display an employee’s weekly gross pay. The program should a...
[5 replies] Last: Read the Arguments passed by value and by reference section http://w... (by integralfx)
C++ fstream question
 
I've been a bit confused lately on how to use fstream. I understand the infile and outfile basics, b...
[1 reply] : Hints: #include <iostream> #include <fstream> #include <limits> #incl... (by Enoizat)
Pages: 1... 34567... 23
  Archived months: [apr2017]

Cannot post in this page. To post a new message, go to the first page.