General C++ Programming - August 2010 (Page 15)

Are class operators more efficient than class functions?
 
There seems no significant difference in the listing between these two expressions: ;x_class=y_value or ;x_class.reads(y_value) Which one is better?
[1 reply] : they're the same, performance wise. Overloading operators just make... (by Disch)
does the or( || ) operator use short circuit evaluation?
 
just like the and( && ) operator?
[3 replies] Last: && and || operator uses short circut evaluation and in C++ we should a... (by rahulroot)
how to use explicit correctly?
 
Hi I'm trying to use explicit to prevent implicit conversions from one integral type to another - but it's not working. Is this just not possible? If I h...
[5 replies] Last: explicit keywords used to avoid implicit conversion from constructor a... (by rahulroot)
by memecs
typedef and size_t
 
Hello, I don't understand why this doesn't compile. It returns an error saying that max(long unsigned int, size_t) does not exist. long unsigned int a = ...
[6 replies] Last: Well, here _SIZE_T is just renamed with typedef directive to avoid ... (by EverBeginner)
by majia1
matrix new and delete / memory leak
 
Hi, There is a memory leak problem in my code, and I could not find where it is. The only place I use new/delete commands is for matrix. I am using the follo...
[18 replies] Last: Line no 21 has problem,its writing beyond boundry error.it must be ... (by rahulroot)
by Tiigon
Global variable doesn't work
 
I tried to create a global boolean to use in two different source files. This is the header file, included in both source files: #ifndef GLOBALS_H #define...
[4 replies] Last: are you including your header file in another source file. Note: In... (by rahulroot)
Searching method
 
Hi I wanted to create a C++ program.Using constructor and proper methods design a class graphics which stores shapes, area, back color, forecolor. Use this ...
[5 replies] Last: Sorry mate, I can't give you the entire program... for 2 reasons: 1. I... (by steve lorimer)
Multi-File Woes
 
I want two classes defined in two files to have members of each other however my compiler isn't letting me do so. main.h: #ifndef MAIN_H #define MAIN_H ...
[6 replies] Last: +1 m4ster r0shi Both .cpp files should be including both headers. ... (by Disch)
by RyRy
Can't get User Input with XOR encryption?
 
#include <iostream> #include <string> #include <fstream> #include <cstdlib> #include <cstring> int main(int argc, char* argv ) { std::ifstream in;...
[10 replies] Last: [quote=RyRy]I get the same binary as their answer. Well that site do... (by Galik)
by majia1
memory leak detect using _CrtDumpMemoryLeaks
 
I am trying to detect memory leak using _CrtDumpMemoryLeaks in Visual Studio 2008. The problem is that it reports the position (file and line number) of some me...
[8 replies] Last: ops, sorry, I made a stupid mistake... Thanks guys! (by majia1)
by jzone3
Quadratic Formula
 
I made a quadratic formula calculator in xcode, but it says "invalid suffix on integer constant" Please help #include <iostream> #include <math.h> using na...
[4 replies] Last: well i figured it out myself. thanks anyway (by jzone3)
Software Questions
 
Okay, I have two extremely vague questions: 1) I was wondering how to make it so one program can detect another program. 2) I was wondering how to make it so ...
[5 replies] Last: This here might help too -> http://www.drdobbs.com/cpp/204202899 (by m4ster r0shi)
by RyRy
Problem with some characters.
 
#include <iostream> using namespace std; int main() { string str; cout << "Input:"; cin >> str; //type in "รณ" cout << "\nOutput 1: ...
[6 replies] Last: I've been advised to not use system calls such as system("Pause"). I ... (by RyRy)
by LJones
public class member modifies private member via pointer, runtime crash
 
I've stripped it down to short files illustrating the issue (I was actually hoping to find the issue, but it didn't happen). I'm sure I'm missing some basic con...
[4 replies] Last: Looking at this now, I truly have no idea what I was thinking. Thanks ... (by LJones)
SFML with Visual C++
 
I have never used Visual C++ much but I am trying to get SFML to work with it. I copy/pasted the include folder and lib files. I tried running the initial c...
[2 replies] Last: Alright I guess I'll just place it in the same directory. (by AdventWolf)
MFC
 
I am working from a code example i found but it uses the following function from the mfc - WCHAR sn ; CString serial; serial.Format(_T("%ws"), sn); I a...
[2 replies] Last: It looks like it's just copying the string in sn to serial. (by helios)
by jhen
2dimension array
 
im a begginer with this kind of program can you help me how to use the 2d array in c++...because i dont know how to make program in 2d array...this would be the...
[8 replies] Last: you know what thanks for that info now i know it....thanks guys!!! ... (by jhen)
by declan
Is it possible to call this operator with a pointer?
 
Hey guys. I have an operator defined for a matrix class, so I can do int someInt = myMatObj(1,4,5); Or something to get the value at that location. But ...
[7 replies] Last: myPtr -> operator() (1,4,5) how about (*myPtr)(1, 4, 5) ?..... (by hamsterman)
Linked List error!
 
Hi, I have the following code which compiles fine but does not produce any output.. using namespace std; #include<iostream> #include<cstdio> #include...
[1 reply] : The problem is that p keep pointing to NULL. Try this //void append(... (by ne555)
Hash_map
 
Hello everyone. I have been trying to make hash using hash_map. The problem is that I have to insert in the hash_map more keys with the same value For exam...
[2 replies] Last: I'm no expert, but 2 things spring to mind. If you are attempting t... (by steve lorimer)
August 2010 Pages: 1... 1314151617... 20
  Archived months: [jul2010] [sep2010]

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