49,761 Topics

Member Avatar for
Member Avatar for KAY111

[CODE=C] #include <math.h> void greedyMatch() { Xnode *u; Ynode *v; arc *e; forallXNodes(u,G) { assert(!u->isMatched()); forallOutArcs(e,u) { #ifdef STATS stats.searchArcCnt++; #endif v = e->head(); if (!v->isMatched()) { #ifdef STATS stats.mVal++; stats.greedCnt++; stats.flowArcCnt++; #endif v->match(u); u->match(v); break; } } } } void augment(Ynode *last) { Ynode *v, *v1; Xnode *w; arc …

Member Avatar for arkoenig
0
113
Member Avatar for mattloto

I am interested in using DirectX to make games. I'm using MinGW, which is a windows command line port of GCC. How would I get it so that DirectX 10 is included in the files? It probably is in the headers, but I don't know which to include because most …

Member Avatar for Ketsuekiame
0
276
Member Avatar for akssps011

I am new to C++ in terms of large projects distributed over various source files. When I compile(gcc compiler) I get the following error: undefined reference to 'C::C()' I have this code: [B]/src/lib/abstract/[/B]A.cpp [CODE] #include "src/plugins/geo/C.h" #include "B.h" class A:public B { public; A() { B m_b; } void speed() …

Member Avatar for akssps011
0
160
Member Avatar for hisugan

...well i would like to practice c++ by analyzing the logic of the sample programs.... ..thank you for your help.. i really appreciate it...

Member Avatar for Ketsuekiame
0
80
Member Avatar for Schoorsteen

Hey there, I am attempting to open Firefox using C++ on Linux (Ubuntu). However, I get an segmentation fault. What am I doing wrong, and what should I do? [CODE]std::cout << system("/usr/bin/firefox") << std::endl;[/CODE] /usr/bin/firefox works in commandline and when I run this program in debug mode in Netbeans, firefox …

Member Avatar for daviddoria
0
576
Member Avatar for venomxxl

I'm writing a small game engine and I have a little problem. The code below shows the exact situation: Header1.h [CODE] #ifndef _HEADER1 #define _HEADER1 #include "Header2.h" namespace HNamespace { class HClass1 { public: HClass1() { } ~HClass1() { } HClass2 * A; }; } #endif [/CODE] Header2.h [CODE] #ifndef …

Member Avatar for venomxxl
0
100
Member Avatar for ndowens

I am wondering if somebody could recommend a good book and/or tutorial for an absolute beginner with no previous programming experience. Thanks. Also If I can do decent at programming, I may end up going to college in order to try and make programming a possible career

Member Avatar for Bench
0
133
Member Avatar for atman

Hello! I'm new to c++ but I have a problem and desparate for help. I'm trying to store string and integers into a file, but only strings get stored and integers dont. I tried casting,didnt work. Not to convolute you with my code, I came up with this small program …

Member Avatar for StuXYZ
0
114
Member Avatar for jsparger

Hi guys, Shortly my research group will be getting a big fancy set of CAEN VME nuclear instrumentation modules. It will be my job to write some C/C++ programs to control all of these modules. That's about as far as I understand. I'm a C++ baby (I know some Java, …

0
35
Member Avatar for NathanOliver

Hey all I have seen a lot of stuff about palindrome checkers so I thought I would write one that works for STL containers as well as arrays. it accepts a bidirectional iterator to the first element and an bidirectional iterator to 1 after the last element. Included is a …

Member Avatar for NathanOliver
3
328
Member Avatar for Grep

Hi guys, I would like to execute something like this in my program: system("C:\test\perl\a.pl"); But the problem is i need to execute: perl a.pl Can't just execute the a.pl and expect it to run. Any ideas on how i could simply open up the cmd prompt with my program and …

Member Avatar for Grep
0
241
Member Avatar for zoner7

I have a vector class that is defined using a template. VS 2010 is underlining every instance of these templates, claiming that the identifier Scalar is undefined. Peculiarly, these errors only occur in the definition of the class I will list first but not the one that inherits it. Here …

Member Avatar for thelamb
0
102
Member Avatar for Grep

I would like my C program to run my perl script: I have something like this in mind: system("C:\test\perl\a.pl"); But obviously it needs to do perl a.pl. Not just execute the a.pl. Any ideas? Something simple would be appreciated.

Member Avatar for Grep
0
55
Member Avatar for has problems

I am having a Visual C++ Debug Assertion Failure. It is happening after the internet opens and then try to go to website thats not the homepage. here is the info in the message: Program: C:/Program Files/Internet Explorer/IExplore.EXE Files:dbgheap.c Line:1132 Expression:_CrtIsValidHeapPointer(pUserData)

0
38
Member Avatar for ShortYute

I'm new to c++ however, I have been doing C for about a year now so OPP and all its related things are new to me ( classes etc. ), i have the program in C so I'm trying to find a better way to implement it... Thanks in advance …

Member Avatar for ShortYute
0
122
Member Avatar for dansnyderECE

I'm trying to use .open() but I'm having an issue with my arguments to this function. Here's my code: [CODE] vector<string> FDT_filename; ifstream is; is.open (FDT_filename[0], ios::binary );[/CODE] Which results in the following error: [CODE] ../sim_main.cpp:297: error: no matching function for call to ‘std::basic_ofstream<char, std::char_traits<char> >::open(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const …

Member Avatar for dansnyderECE
0
182
Member Avatar for AspiringCoder

How would you take an int and make each diget into a array element? For example: [CODE]int num = 12345; int nums[4]; // how ever you enter numbers into the array // would result in: // nums[0] = 1 // nums[1] = 2 // and so on...[/CODE]

Member Avatar for AspiringCoder
0
170
Member Avatar for dohpaz42

In a nutshell I am trying to write a program that will connect to a database, query several tables for various sets of data that will then be transformed into XML that is stored into a file on the local hard disk. My first thought process to solve this problem …

Member Avatar for dohpaz42
0
203
Member Avatar for stonerain

I am trying to use the CalcOpticalFlowBM function but I don't understand hot it works. I want to find a motion vector for every blocks but I don't understand that the CalcOpticalFlowBM yields velX and velY. I wrote below code . [CODE]/* Create an object that decodes the input video …

Member Avatar for bart.scotty
1
697
Member Avatar for dinesh.isuranga

I have a Report Model List Controller and I want to get Selected Row Of data to be used.. my Row has there are four data colums.. Name.Age,Birth and Salary... please help me to solve this... thanks...

Member Avatar for CrazyDieter
0
82
Member Avatar for zainabalkhalili

i need help converting this C++ to pseudocode help me pleasee [CODE]#include <iostream> using namespace std; { string Z[]={"zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"; string A[]={"zero","ten","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"; int N,N1,N2,N3, r; string text; N1=N/100; r=(N-(N1*100)); if (r<20){ cout<< Z[N1]+"hundred and"+A[r]; } else{ N2=(N-N1*100)/10; N2=r/10; N3(r-(N2*10)); cout<<[N1]+"hundred and"+A[N2]+[N3]; } cin>>N; return 0; }[/CODE]

Member Avatar for markzain
-2
84
Member Avatar for kudalwarang
Member Avatar for dansnyderECE

I think this is an easy question but I don't know the answer to it. How does one link the value of an argument to a function and the functions parameters? For instance: [CODE]int a; int b; void fn(int &c, int &d) { c++; d++; } int main() { fn(a,b); …

Member Avatar for aman rathi
0
175
Member Avatar for Alex314

Hello, This is probably trivial, but I can't find a solution to the following problem. In C++Builder 2007 I was able to write different strings both to the Application's Title and to the Main Form's Caption. In the Title I displayed the name of the Application; in the Caption (showing …

Member Avatar for Alex314
0
150
Member Avatar for dchunt

Say i have a 256 byte file. How many additions or multiplications can a modern computer perform on them using c++ ? I've been working on this c++ compression project that does a lot of calculations. I use Dev-cpp,and am a amateur programmer,i've not used pointers,vectors or anything fancy yet,anyway …

Member Avatar for thelamb
0
1K
Member Avatar for mksakeesh

Please check the below code template<class T> class Row { public: Row(int cols=0):row(NULL) {SetRowSize(cols);} ~Row() {SetRowSize(0); } Row(const Row &r):row(NULL) { SetRowSize(r.numCols); for (int i=0;i<numCols;i++) row[i]=r.row[i]; } void SetRowSize(int n) { if(row) delete[] row; if (n>0) { row=new T[n]; memset(row,0,sizeof(T)*n/sizeof(char)); } else row=NULL; numCols=n; } int size() { return numCols;} …

Member Avatar for thelamb
0
119
Member Avatar for dualdigger

How can I manage to lock or unlock access db query table. e.g. I have a game which displays few questions and then answers which are taken fromt the access db records. What I want is during the game play, it should remain lock till it is accesed, so that …

Member Avatar for nehasidana
0
196
Member Avatar for aliyami90

Hi guys How do I search a file ".txt" which contains three lists side by side for a word , then print the line that the word I searched for is in? NOTE: -The lists are lists of names . it would be beter if you show how to do …

Member Avatar for aliyami90
0
129
Member Avatar for nyarufuka

Guys I am seeking help on the following two dimensional arrays, using matrices. (a) Enter elements of two matrices A and B. (b) Add the matrices and store the result in matrix C. (c) Subtract matrix A from matrix B, and store the result in matrix R.

Member Avatar for mrnutty
0
89
Member Avatar for usafsatwide

I'm in a computer programming class and having trouble. The assignment is: [I]Write a program that uses a structure named MovieData to store the following information about a movie: Title Director Year Released Running Time (in minutes) The program should create two MovieData variables, store values in their members, and …

Member Avatar for NathanOliver
0
417

The End.