49,757 Topics

Member Avatar for
Member Avatar for Labdabeta

Just wondering which of these functions would be faster (or if they would be the same): [CODE]class MyClass { private: bool MyVar; public: MyClass &Function1(bool MyVar); MyClass &Function2(bool MyVar); MyClass &Function3(bool var); }; MyClass &MyClass::Function1(bool MyVar) { this->MyVar=MyVar; cout<<MyVar; return *this; } MyClass &MyClass::Function2(bool MyVar) { this->MyVar=MyVar; cout<<this->MyVar; return *this; …

Member Avatar for Labdabeta
0
101
Member Avatar for NiTeHaWk4787

Hey everyone, I'm having some trouble writing this program using queues. The main issue that I'm having right now is that I have three queues, each is size=5. The user inputs a number to remove from a queue. The program will pop all the values out of the 3 queues …

Member Avatar for NathanOliver
0
114
Member Avatar for pcgamer2008

Hello World ! I have problem regarding configuration of OPenAL in Dev c++. I have included openal32.dll in system32(Windows), alut.dll in system(windows folder), included alut.h,al.h in AL directory (c:\dev cpp\include\AL) as well and linked all the files viz. -lopenal -lalut. but the source code is not getting compiled..What's the problem. …

Member Avatar for Stefano Mtangoo
0
419
Member Avatar for MareoRaft

[CODE]int operator%( double a, double b ){ int aa = (int) a; int bb = (int) b; return aa%bb; }[/CODE] gives me an error message "must have an argument of class or enumerated type"! As you can see, I want a simple program which truncates doubles into their equivalent integers, …

Member Avatar for NathanOliver
0
7K
Member Avatar for tow3lie

Hello,software comrades! I have a task to do, and I have figured some part of it,but I have troubles with it.So i am writing and asking for some advice. The task is as it follows: You are to create a program (C++ language) in which u enter a number (preferably …

Member Avatar for MareoRaft
0
185
Member Avatar for killingmonk

OK, I looked for a noob section to the forum, but didn't find one. So here's my issue. I'm doing an exercise from a text book for a class I took two years ago. Back then, this wouldn't have been an issue. Now, having not looked at C++ for all …

Member Avatar for killingmonk
0
218
Member Avatar for MasterGberry

So i am a very fluent C++ programmer, and am switching over to PHP/Javascript/MYSQL for some new work that I am doing. I know all the basics of C++ and some of the more advanced STL libraries. I know very basic PHP simply cuz I already know all the arrays, …

Member Avatar for chrishea
0
486
Member Avatar for Triarius

Hi! I am trying to make a simple "Guess my number" game. For some reason the compiler (Visual Studio 2010) gives me an error. Here is the full code : [CODE]#include<iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { int tries = 0; int input; srand(static_cast<unsigned int>(time(0))); int …

Member Avatar for vidit_X
0
100
Member Avatar for jeffpro

2 Questions: 1. How is the windows cursor drawn? ddraw? I don't understand and I can't find any information on it. 2. When you control alt delete in windows 7 how is that screen drawn? Thanks

Member Avatar for jeffpro
0
193
Member Avatar for eng hassan

[TEX]This is a game i have made, but I have some problems in the breed & eat functions I dont know what is the problem & i really need help. the code works probably but the prey & the predator doesnt breed or eat,,,ANY HELP PLZZ[/TEX] [CODE]#include <iostream> #include<windows.h> #include<conio.h> …

Member Avatar for raptr_dflo
0
1K
Member Avatar for laim

Hi, I have to build a matrix class with functions that you would expect, Im wondering if anyone can tell me why one or both of these functions arent working correctly? Basically a test harness is run against them to check so the data is random. Im sure it is …

Member Avatar for laim
0
125
Member Avatar for jbennet

HI. I'm reading in a wave file and writing it to a sound device using ALSA. Im not a C++ guy (C#) so not very handy with its file I/O methods.. Any idea how do i change : [code]int rc = read(0, buffer, size);[/code] To work with any file i.e. …

Member Avatar for raptr_dflo
0
3K
Member Avatar for kumarmpk4u

Hi all, In my MDI when i try to execute i am getting an assertion error pointing to wincore.cpp line 311. [CODE]BOOL CWnd::Attach(HWND hWndNew) { ASSERT(m_hWnd == NULL); // only attach once, detach on destroy ASSERT(FromHandlePermanent(hWndNew) == NULL); // must not already be in permanent map [/CODE] here is the …

Member Avatar for raptr_dflo
0
868
Member Avatar for yah2009

[B]hi help me in resolving these questions [COLOR="Red"] 1. Write a program which finds the factorial of a number entered by the user. (check for all conditions) (Beginner). 2. Develop a program to convert currency X to currency Y and visa versa (beginner). 3. Write a program that print out …

Member Avatar for Nick Evan
-2
145
Member Avatar for Batch File

I am new to the c++ programming language and I need help. So I have created the program in the extension .cpp ,but how can I run it, its just text! Is their anyway I could run it as a program from command line or an executable file? Plz help. …

Member Avatar for Batch File
0
149
Member Avatar for eman 22

I have an integer array and I want to fill it. [CODE] int* a=new int[7]; [/CODE] but I want to check at first if the element a[i] is set before or not. Ex. a[3]=2; a[3] has value but all elements in a hasn't have any value until now, How can …

Member Avatar for Narue
0
84
Member Avatar for hntdtt

Help me please. My PC is connected to a Olivetti printer through COMM1 port and I installed driver for the printer, but after do this, i can not program to open comm port in C#. The Error display: The given port name does not start with COM/com or does not …

0
32
Member Avatar for FiToKa

Hello, everybody. I'm having some terrible task for homework and I'm just out of my mind. Here it is: [I][COLOR="Red"]Define a class Deque that represents a deque of strings by keeping its elements in a dynamically allocated array (with maximum capacity) and make the deque as a "circular array" (the …

Member Avatar for FiToKa
0
137
Member Avatar for ssesham1

Hi, I want to use a template function that is used to convert strings to numeric types in a non-templated class. I have: [CODE] class Reader { ... template <class T> T ConvertString (const std::string str); }; [/CODE] Is it possible for me to define the template function in an …

Member Avatar for thekashyap
0
406
Member Avatar for XMasterrrr

Hello guys as i see this is a little error and i don't know how i can't fix it so the following are the main and the header file from the book i learn from: main: [CODE]#include "../std_lib_facilities.h" int main() try { vector<int>numbers; int number; cout << "Enter the numbers …

Member Avatar for Salem
0
407
Member Avatar for Seaboot

I am interested in learning simple 16 bit interaction of code between Turbo C++ 3 and Masm 6.11. Could anyone describe how that would basically work in terms of what statements in either contribute towards the interaction. Thanks.

Member Avatar for Ancient Dragon
0
258
Member Avatar for XMasterrrr

Hello guys as i see this is a little error and i don't know how i can't fix it so the following are the main and the header file from the book i learn from: main: [CODE]#include "../std_lib_facilities.h" int main() try { vector<int>numbers; int number; cout << "Enter the numbers …

Member Avatar for XMasterrrr
0
246
Member Avatar for merse

I would like to ignore empty line and line started with # [CODE] std::string line; while (getline(input,line)) { if (line[0] == '#') continue; if (line[0] == '?') continue; ... } [/CODE] Where ? is, I would like to put the end line character, but what is it in C++?

Member Avatar for mrnutty
0
213
Member Avatar for dgreene1210

I am only a very beginner and was wondering if anyone can give me some help in determining how to fix the error messages i keep getting when i try to compile. I have been pulling my hair out for 3 days. Any help is much appreciated! attached is the …

Member Avatar for MareoRaft
0
973
Member Avatar for MareoRaft

This program refuses to take foom as input, yet if I were to put "matrix.txt" into the function instead of foom, it would work fine. [CODE]#include <fstream> #include <iterator> #include <sstream> #include <vector> #include <string> // needed? using namespace std; typedef vector<double> Vec; typedef vector<Vec> Mat; Mat readMatrix(string foom){ Mat …

Member Avatar for mrnutty
0
238
Member Avatar for dgreene1210

I am only a very beginner and was wondering if anyone can give me some help in determining how to fix the error messages i keep getting when i try to compile. I have been pulling my hair out for 3 days. Any help is much appreciated! attached is the …

Member Avatar for raptr_dflo
0
169
Member Avatar for gil_mo

Hi, Absolute newbie to cryptography. I'm looking for C++ open source code (to be compiled on Windows, Mac, linux), for doing the following: 1. Generate private+public keys (need not run on all platforms). 2. (server side) Adding a digital signature to an XML document using a private key. 3. (client …

Member Avatar for raptr_dflo
0
275
Member Avatar for localp

I am using Visual Studio 2008. I created a windows Console project and wrote my code. it compiled well and the program created a default .exe file. Now i created another project. this time its a C# project, and i am trying to access the functionality from the C++ project …

Member Avatar for raptr_dflo
0
161
Member Avatar for racumin

Hi I am implementing a "Star Craft" game and I have troubles on my A* algorithm. I followed the steps in [URL="http://www.policyalmanac.org/games/aStarTutorial.htm"]here[/URL] and created my own implementation using object oriented c++. Now when I have say 32 x 32 grid, and I need to move 1 unit, it takes for …

Member Avatar for mehdi_gol
0
484
Member Avatar for learningcpp

Hi All, Can you please help me to understand why the following code is behaving this way? I think both outputs should be 1 ( 1 means const T), but its not!! [CODE] template <typename T> struct IsConst{ enum {isConst = 0}; }; template <typename T> struct IsConst<const T>{ enum …

Member Avatar for learningcpp
1
3K

The End.