49,761 Topics
| |
I have a problem when I declare template class inside another a template class. [CODE]#pragma once template<typename T> class D<T>;//error 1,2 template<typename T> class B { D* d; public: B(void){ } ~B(void){ } }; [/CODE] [CODE]#pragma once #include<iostream> using namespace std; template<typename T> class B<T>;// error 3 template<typename T> class … | |
hi i am facing same error, but when i go to defination and update code same as you suggest but it wont work, Error : Error 1 error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended. c:\Program Files\Microsoft … | |
Hey guys! I am new at Class and object things. Before introducing the object oriented issues my life was easier! I wrote these codes here: /*--------------------------------------------------------------------------------------- Source File: OOP4.Henri.cpp Program name: Object Oriented program, Assignment 4 Author: Hassan Aghaei Baradaran (Henri) Compiler: Bloodshd Dev-C++ 4.9.9.2 Purpose: To define and demonstrate … | |
In my code i have got when player touches point,it registers collision and prints out score in the console, the problem is that for some reason instead of just printing one score-point per point (There is 10 points in the array) it continues to add score for as long as … | |
Hey; I'm trying to change the mode of a file in Linux system. I know I must use chmod(const char* path, mode_t mode) but I don't really know how to handle the mode. How can I manipulate mode_t variable to apply my own mode? | |
Hi , I need to parse a file that contain linux interface information. My file text is like below [QUOTE] Interface ge1 Hardware is Ethernet Current HW addr: 00a1.2599.0003 Physical:00a1.2599.0003 Description: BC3 - Slot 3 (Phys Slot 7) index 5001 metric 1 mtu 1500 duplex-full arp ageing timeout 0 <BROADCAST,MULTICAST> … | |
I have been written 2 classes A,B. and I want class A to use class B and vice verse but I have a problem when I tried to get the content of the class like(*A) that's my code. [CODE]#pragma once #include<iostream> using namespace std; class B; class D { B* … | |
Here is the VC++ code [code]SVisFileDescriptor filedescriptor1; ZeroMemory(&filedescriptor1, sizeof(SVisFileDescriptor)); filedescriptor1.has_alpha_channel=CVisImageBase::IsAlphaWritten(); filedescriptor1.jpeg_quality=0; filedescriptor1.filename=currentpath1; pframe->SetTimer(22,5000,NULL); imageS1.WriteFile(filedescriptor1);[/code] This block is basically replicated in 3 different functions which in essence save 1 image EACH from a camera connected. I am not sure why this is happening. But my hunch is there is an overlap … | |
Hi, I've just started learning C++ and I have a problem figuring out an assignment. It would be really great if someone could please help me. :icon_cheesygrin: The program should look something like this: Input number: 6 (then the program should read out following) * ** *** **** ***** ****** … | |
| The code below is what I have done up so far. I'm currently trying to complete one of the 4 classes I have, so the codes are incomplete and made to work at it's current stage. Q1. I need to have 3 different sorting criteria: 1.Sort by X (asc/desc) 2.Sort … |
I am using Microsoft Visual Studio 08 version on a computer where I do not have admin privileges. After building my project, I want to put the .exe into the Visual Studio 08's VC folder in order to run dumpbin from the command prompt, but it won't let me copy … | |
waht the steps to make c++ compiler my compiler is to define - ,+ * / mathematical expresstion ? how i can make it plz :) i realy need help | |
[I][B]I'm[/B][/I] trying to load compressed images to a sprite object with C++, using a [URL="http://msdn.microsoft.com/en-us/library/bb174249%28v=vs.85%29.aspx"]LPD3DXSPRITE[/URL] and the [URL="http://msdn.microsoft.com/en-us/library/bb172802%28v=vs.85%29.aspx"]D3DXCreateTextureFromFileEx()[/URL] function to load it and of course [URL="http://msdn.microsoft.com/en-us/library/bb172867%28v=vs.85%29.aspx"]D3DXGetImageInfoFromFile()[/URL] to get some info, but I don't know how to go about it. How do I decompress them before loading them to memory and … | |
[CODE]class Connection { public: typedef boost::shared_ptr<Connection> pointer; static pointer create(boost::asio::io_service& io_service){return pointer(new Connection(io_service));} explicit Connection(boost::asio::io_service& io_service); virtual ~Connection(); boost::asio::ip::tcp::socket& socket(); -->>>virtual void OnConnected()=0; void Send(uint8_t* buffer, int length); bool Receive(); private: void handler(const boost::system::error_code& error, std::size_t bytes_transferred ); boost::asio::ip::tcp::socket socket_; };[/CODE] when am trying to use virtual void OnConnected()=0; it … | |
| Line2D Points is made up of Point2D x and y Line2D.h [code] #ifndef LINE2D__H #define LINE2D__H #include <iostream> #include <fstream> #include <string.h> #include <ostream> #include <sstream> #include <cstdio> #include <vector> #include <set> #include <cstdlib> #include <ctype.h> #include "Point2D.h" using namespace std; class Line2D { friend ostream& operator<<(ostream&, const Line2D&); private: … |
I want to declare template inside a class .h file [CODE]# include<stdio.h> # include<iostream> using namespace std; #pragma once template <typename T> class LeafNode { T records; LeafNode* next; int size; public: LeafNode(void); ~LeafNode(void); };[/CODE] .cpp file [CODE]#include "LeafNode.h" template <typename T> LeafNode::LeafNode(void) { } template <typename T> LeafNode::~LeafNode(void) { … | |
I really need help on my latest C++ assignment. The program was due a week ago and I'm still beating my head against a wall here. This is supposed to be a VERY SIMPLE linked list implementation. I have rewritten this dang thing countless times in as many different configurations … | |
I am using Borland C++ Builder 5. I wish to use a TRichEdit component, and be able to programmatically add text to it, and be able to have different fonts/colors within the same line of text. I am able to change the font/color just fine, but only know how to … | |
1. int i=1; 2. while (i <= n) { 3. for (int j=1; j<10; j++) 4. sum++; 5. i++; 6. } 7. for( int j = 1; j <= n; j++ ) 8. for( int k = 1; k <= n; k=k*2 ) 9. sum++; 1. How many times is … | |
I wrote this script for my classmates where we shoot at each other, but after it compiles it says that there was an error and exits out. heres my script, if there is anything in there that needs to be fixed please help me. [CODE]#include <allegro.h> #include <process.h> #include <stdio.h> … | |
So I have this assignment to create a dynamic stack with template and I've got it nailed pretty much. My question, though, is: I tried to implement "stack2" originally with data type as string. It would not work. The compiler threw all kinds of errors. Could somebody tell me what's … | |
Hey guys! I'm trying to write a program that calculates the area of the convex hull of a set of points in a plane. I can find which points construct the convex hull but calculating the area is a little bit difficult for me. I guess the problem is that … | |
I'm trying to create a Chat program for people to talk to each other through. So far I have it so multiple clients can connect to the server and send/receive messages to/from the server. The problem I'm having is because of the way Clients that are connected to the server … | |
Hi, I don't know where i when wrong... But my program doesn't want to loop properly. I was ask to make a Simple calculator that will loop the ans till giving a exit. here is what i got... #include <iostream> #define NEWLINE "\n\n"; using namespace std; int main() { char … | |
Heres a interesting question for you guys, is it possible to check a file to see if its signed in c++ and if you wouldnt mind could you write me a function how to do this as it would really help alot, thanks. Kindest Regards, Nathaniel Blackburn | |
I deleted IDR_MAINFRAME256 and need to add it back to my toolbar folder under Resource View. How do I add it back. | |
Hey; I have an assignment. My assignment includes the following tasks to be implemented under Linux: – Display a list of all available files (with their types) in the working directory, – Display a list of only regular files in the working directory, – Display a list of only directories … | |
This worked in VC++ 6 but in Visual Studio 2010 assign needs a second parameter, in the context of this function would it be a better idea to use resize or reserve and why? [CODE] bool CN3ShapeExtra::Load(HANDLE hFile) { bool bSuccess = CN3Shape::Load(hFile); int iPC = m_Parts.size(); m_Rotations.clear(); if(iPC <= … | |
Hello, I have two forms named are Form1 and Form2 (Form1.h / Form2.h) There are a textbox and a button on Form1 and Form2. When I click the button on Form1, it must show Form2 and when I click the button on Form2, it must fill the textbox on Form1 … |
The End.