49,766 Topics

Member Avatar for
Member Avatar for mrnobody

Hi, I get "error LNK2005:" when I build my source code. Below is what I did: Main.cpp [CODE]#include Main.h Function();[/CODE] Main.h [CODE]#include "File1.h" //#include "File2.h"[/CODE] File1.cpp [CODE]#include "File1.h" void Function() { // Do something }[/CODE] File1.h [CODE]extern void Function()[/CODE] File2.cpp [CODE]#include "File2.h" void Function() { // Do something }[/CODE] File2.h …

Member Avatar for pseudorandom21
0
97
Member Avatar for AshfaqueIW

Hi all, I have a application which is completely written in C++. I got one review comment that normal class methods should not have any static variables and i am advised to move that variable inside class. I want to know what will be advantage of keeping the static variables …

Member Avatar for JasonHippy
0
230
Member Avatar for EddieC

Craigslist hosts classified ads of all kinds, including lengthy lists of [url=http://newyork.craigslist.org/sof/]developer's jobs in New York[/url] and the [url=http://sfbay.craigslist.org/sof/]San Francisco Bay area[/url]. But another type of job listing was in the spotlight today, and it's nice to know there's at least [i]one[/i] person out there who's thinking clearly. A judge …

Member Avatar for maile15
0
572
Member Avatar for suraj_p

When i run this program it takes more values and prints less values.... this runs on Dev C++([url]www.bloodshed.net[/url]) [CODE]#include<iostream> using namespace std; #include<conio.h> int main() { int arr[5][5],i,j,k,l; cout<<"Enter matrix row wise"; for(i=0;i<=3;i++) { for(j=0;j<3;j++) { cin>>arr[i][j]; } } for(k=0;k<3;k++) { for(l=0;l<3;l++) { cout<<" "<<arr[k][l]; } printf("\n"); } getch(); } …

Member Avatar for suraj_p
0
178
Member Avatar for ztdep

[CODE]// // DiffusionTerm.h define the equation class to be solved. // #ifndef DIFFUSIONTERM_H #define DIFFUSIONTERM_H #include<vector> #include<iostream> using namespace std; class Equation; class DiffusionTerm { private: Equation* pEquation; public: DiffusionTerm(Equation* _pEquation ){pEquation=_pEquation; }; ~DiffusionTerm(){}; vector<double>Coe; vector<double>source; void evaluateCoeAndSource( ) { vector<double>& ThermalConductivity= pEquation->pMedia->getThermalConductivity() ; } }; // // Equation.h define …

Member Avatar for ztdep
0
256
Member Avatar for ztdep

[CODE]// // Media.h define the class cell // #ifndef MEDIA_H #define MEDIA_H #include<vector> #include<string> using namespace std; class Media { private: // media name string name; // the density vector vector<double> density; // the capacity vector vector<double> cp; // the thermal conductivity vector vector<double> thermalConductivity; // the viscorsity vector vector<double> …

Member Avatar for mike_2000_17
0
8K
Member Avatar for sadsdw

Hi friends, I'm retrieving some information from a input file with 10 columns and I need to get the first 3 columns and set into 3 different variables and the last 7 in the same variable. I was using "ifstream" and ">>" like: [CODE]myfile >> stringA; myfile >> stringB;[/CODE] ... …

Member Avatar for sadsdw
0
96
Member Avatar for mayanktalwar

open cv[code]#include <cv.h> #include <highgui.h> #include<stdio.h> int main() { cvNamedWindow( "Example2", CV_WINDOW_AUTOSIZE ); CvCapture* capture = cvCreateFileCapture( "a.avi" ); IplImage* frame; if(!capture) { printf("fail"); } else{ while(1) { frame = cvQueryFrame( capture ); if( !frame ) break; cvShowImage( "Example2", frame ); char c = cvWaitKey(33); if( c == 27 ) …

0
61
Member Avatar for reallyslick

I have not found a solution yet, please help! My header files are structs which house the declarations of my functions and the associated CPP file houses the implementation. I want to pass a string to my ADD and REMOVE but get compile errors.. [CODE]/// //Profiles.H /// #ifndef __PROFILES_H #define …

Member Avatar for ztdep
0
814
Member Avatar for ztdep

Dear friends: I have the following two classes.[CODE]#ifndef EQUATION_H #define EQUATION_H #include <stdlib.h> #include <map> class Mesh; class Equation { public: Equation(); virtual ~Equation(){}; void associateMesh(Mesh * _pMesh){ pMesh = _pMesh;}; virtual void addsItsVariables4PostProcessing(map<string,const Variable*> & variablesMap)=0; protected: string name; const Mesh* pMesh; }; #endif [/CODE] Before the class Equation, …

Member Avatar for ztdep
0
283
Member Avatar for bigdan182

hey, I promise i'm getting there!! so my code now seems to be emptying the structures as they are passed between the functions, any thought on how to fix it? also if anyone knows of any good examples of passing by reference, that could apply to this code that would …

Member Avatar for NathanOliver
0
148
Member Avatar for diana_pro

HI, I started to play with files in C++ and I have a little problem. Here is my c++ project and the problem: main.cpp [CODE]#include <iostream> #include "resource.h" #include <windows.h> #include <stdio.h> #include <fstream> using namespace std; int main() { HRSRC hRsrc; hRsrc = FindResource(NULL, MAKEINTRESOURCE(IDR_MYTEXTFILE), TEXTFILE); if (hRsrc == …

Member Avatar for Prosammer
0
149
Member Avatar for tedman102

I have tried to get this program to work with no luck. How do you properly use the nested selection structure? (sorry for the lack of braces, I tried getting rid of some for less confusion. Didn't think it would work but thought I might as well try :D). I'm …

Member Avatar for tedman102
0
430
Member Avatar for afi@alvi

Any ONE who can solve this problem.... "Permutations: The challenge is to find the algorithm used to create all possible permutations of a given string"

Member Avatar for arkoenig
0
105
Member Avatar for L3gacy

Hey guys I basically finished reading Beginning Visual C++ 2010 with Ivor Horton, I skipped the MFC part as I am more interested in the Win API which there's was only one third of a chapter on(not enough) and I was wondering if Programming Windows, Fifth Edition by Charles Petzold …

Member Avatar for L3gacy
0
190
Member Avatar for marcux

Hi all! After surfing the web I ended up here as I could not find a good answer! I am writing an application with c++ and gtkmm. I want to access the network card and listen on all ports for packages. As far as I have found out it is …

Member Avatar for marcux
0
380
Member Avatar for turista

I have this working code but my teacher wants really specific things. codes always have to be OOP, and this needs to to have no more then 2 cout. i have 3 but cant seem to find away to take one out. my friend told me i should do this …

Member Avatar for turista
0
268
Member Avatar for pablocremita

Hello, First of all, sorry for my english. I will try to make me understand. I'm doing a program with CodeGear C++Builder 2009 that manages a few tables. The tables were created with Database Desktop 7.0 (dbd32). Between these tables there are a table whose name is 'Evaluation'. His estructure …

Member Avatar for gusano79
0
554
Member Avatar for Stefano Mtangoo

I have been learning PHP MVC pattern and it is pretty cool. have almost finished app and I can see how mess you can make a code without good design. Now can MCV be applied to C++ apps? Where does Plugin manager/Plugins go if that is even possible?In model or …

Member Avatar for Stefano Mtangoo
0
174
Member Avatar for Peyton

Hi, I was given this class member function that overloads the == operator. I don't understand it. Please could you help me understand it? Here is the class [CODE]class Word { public: // constructor Word(const string& word); // overloads is-equal-to (or equivalence) operator - this is very useful for testing, …

Member Avatar for Peyton
0
148
Member Avatar for mattiapdo

Hi I'm new in this forum. I'm an italian student (not an expert of c++) , so I perharps will not understand very well English (escuse me); I wanted to create a program in C++ that let me to receive the translation in Morse Code of a string... Do I …

Member Avatar for Sodabread
0
2K
Member Avatar for siaswar

Hi I'm software engineering student. I know python, c, c++ and c#. It's been two years I'm trying to learn programming but somehow I still a beginner. I just know the syntax of these languages. I love Linux and open-source. I tried to learn programming in Visual Studio but my …

Member Avatar for katmai539
0
220
Member Avatar for bimoweemo

Im getting a bunch of errors from the compiler.Not sure what im doing wrong.... Header File [CODE] #include<iostream> using namespace std; #ifndef STACK_H #define STACK_H template<class stackElem, int maxSize=80> class stack { public: stack() { top=-1; } bool push(const stackElem &item); }; #include "stack.cpp" #endif [/CODE] this is the .cpp …

Member Avatar for alwaysLearning0
0
85
Member Avatar for Jsplinter

I've tested the following code in a console application, and it compiles just fine. However, when I copy it to a header to include in a larger project, I get 77 link errors, all related to boost. If I comment out the line in [COLOR="red"]red[/COLOR], everything compiles just fine without …

Member Avatar for pseudorandom21
0
449
Member Avatar for palsoft

Hello, Is there some possibility to export end game result from EA Sports game NHL 2002? I want to use it for my web cup-administration tool. I haven't any experience with C++ (what I think NHL 2002 is written in) nor any debuggers. Could you please help me or give …

0
76
Member Avatar for Kerlix

I'm using VS 2010 and I always get multiple error messages: '<<': no operator found which takes a left-hand operand of type 'std::string' (or there is no acceptable conversion). I get that for lines 36 and 52. Then I get "Intellisense: no operator "<<" matches these operands for lines 36 …

Member Avatar for Caligulaminus
0
311
Member Avatar for fsefsef23

Sorry for the confusing title. Basically I have a line which I read from a file that gets stored as an array stack of characters that reads as follows: Nn<-<-<-<-No <-w iz<-sthe<-<-<- the time. Where the top of the stack is the '.', and the bottom is the 'N' respectively. …

Member Avatar for WaltP
0
423
Member Avatar for har58

Hi, I have written a small program to calculate Fourier coefficients of square wave. [CODE] #include<iostream.h> #include<stdlib.h> int main() { int *A,*B,a,n,i,; float pi=3.14; cout<<"Enter value of amplitude"; cin>>a; cout<<"Enter which harmonic you want to display"; cin>>n; A=new int[n+1]; B=new int[n+1]; A[0]=0; for(i=0;i<=n;i++) { B[i]=0; } for(i=2;i<=n;i=i+2) { A[i]=0; } …

Member Avatar for shokichi
0
2K
Member Avatar for thecoolman5

Hi, I am trying to make a one octave piano. heres my code: [CODE]#include<windows.h> #include<mmsystem.h> #include<stdlib.h> /* Declare Windows procedure */ LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM); /* Make the class name into a global variable */ char szClassName[ ] = "WindowsApp"; int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, …

Member Avatar for thecoolman5
0
1K
Member Avatar for nisabalish
Member Avatar for jonsca
0
59

The End.