General C++ Programming - August 2014

Classes and Structs
 
I'm doing a project for my Advanced C++ class and I am to use a class to get the user to input a roman numeral and the output will be the positive integer. Soun...
[2 replies] Last: Ok thanks. (by dub1987)
initializing pointers to memory addresses or values?
 
What is the difference between initializing pointers to a memory address using the address operator like int *pointer = &x; or initializing it to a value li...
[4 replies] Last: And assign them to pointers/references to arrays. And typedef them And... (by Disch)
<> Compiler and Linker errors for my linkedList class and application
 
I am trying to write a program that will take a list of integers from a file and write them to another text file. I've been banging my head at this for days try...
[6 replies] Last: How should the template arguments be declared? I've fixed everything ... (by br26354)
stopping threads without using local var?
 
hi, here's my code, #include <iostream> #include <unistd.h> #include <thread> using namespace std; void Blink(); bool blinkit; int main() { b...
[3 replies] Last: Your current code does not use a local variable. Do you mean "global" ... (by LB)
comparing two string in if statement
 
HI i actually i want store string in r and try to compare other string (room_no) in function check but i try many time it still having error can someone help me...
[2 replies] Last: First, a use of code tags and indentation in posts makes commenting ea... (by keskiverto)
by LB
Determine if a type is of a more derived type than another at runtime
 
I have a function like this: template<typename T> void f() { //... } Is there any way I can construct a list of the types it is called with ordered from lea...
[6 replies] Last: Yeah, my problem is that I will never be able to know of all the types... (by LB)
socket programming
 
So I'm trying to learn some socket programming, and I'm at the point where I need a server to interact with. After googling, I see people renting out VPS servic...
[1 reply] : The first solution is to use another device on your network. The secon... (by Computergeek01)
guys please help out with this theory qns
 
Determine the BEST structure to use when you want to output various messages based on a code letter representing a person’s marital status (e.g., ‘m’ for ...
[7 replies] Last: You had the right idea with using a switch statement ;) (by LB)
plz give an answer,,urgent
 
//output problm.. #include <stdio.h> #include <conio.h> int main() { int i=1,l=-2,k=11,j=0,m=1; if((i++ && l--) || (k-- && j--) && (m++)) { ...
[3 replies] Last: It's due to short circuit logic in the if statements. If you have [x O... (by Ganado)
Why i can't delete this pointer
 
#include <iostream> using namespace std; void main(){ char *B ; for (int i = 0; i < 12;i ++) { B = new char; itoa(i,B ,10); } for (...
[4 replies] Last: @keskiverto: Ok, I see, thanks sir (by namangcau)
by AceK
JUST WANT A SIMPLE EXPLANATION
 
Hi there, I have seen a class declaration as in line 3 in the code below and I don't know what this kind of declaration does and how is it different from adding...
[1 reply] : That is a forward declaration for a class. It tells the compiler that ... (by TwilightSpectre)
Use of "using namespace std"
 
What is the use of "using namespace std" in c++ programme.What difference does it make with a normal programme.I use Turbo c to compile my c++ programme but it ...
[3 replies] Last: Thank you for your help (by Gnana Kumar)
by tmason
Dynamically deleting items out of vector ...
 
Hello, I have the following code in which I wish to dynamically delete items out of a vector based on the condition of the item in the vector. The below code ...
[9 replies] Last: Wow, OK, I need to brush up on modern c++. I haven't used lambas or e... (by tmason)
by Kubani
Circle fill color in, FLTK
 
Hi, I installed FLTK 1.3.X (from here http://www.fltk.org/index.php ) on my visual studio 2012 compiler and use PPP book for programming (this: http://www.stro...
[3 replies] Last: Thank you for your reply anyway. (by Kubani)
Creating and Terminating Threads
 
Hi All, I am new to C++ and Threads. I had a requirement where i needed to create a thread and if the execution of thread is not completed in 5 minutes i ...
[2 replies] Last: Thanks for your reply Peter. Could you give me a small piece of code ... (by pdsharma86)
Input from csv file to C++ (1,2)
 
Hello guys. I've values in a csv file and I'd like to load these values into an array in C++ to perform some processes on them. example of csv file: 10 2 ...
[21 replies] Last: Read what the ignore() does. (by keskiverto)
where do I enter in the appropriate numbers?
 
I don't understand this at all! I read the chapter and I still am having a horrible time. #include <iostream> using namespace std; int main() { int...
[1 reply] : Did you compile the program and try to run it? (by LB)
overloading members on constness Problem
 
Link: http://www.cplusplus.com/doc/tutorial/templates/ Part:Const member functions Why bar.get() = 25; did not work although I used int get() const {return...
[8 replies] Last: 1.The overloads of get would render one ambiguous, and so it is imposs... (by helshahaby)
Need help on text-based game.
 
So this is my code so far: #include "stdafx.h" #include <cstdlib> #include <iostream> int getInput(); void DisplayMainMenu(); void displayCredit...
[3 replies] Last: Yeah, I guess I should have specified that part, also. (by whitenite1)
by Aceix
Memory leaks
 
Hello, of a truth memory leaks are not good, but how dangerous can they be? Can a cracker use it to read some information hidden in your programme's memory spac...
[5 replies] Last: > do OS limit the amount of memory assigned to a programme? By itself... (by JLBorges)
August 2014 Pages: 123... 25
  Archived months: [jul2014] [sep2014]

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