49,761 Topics
| |
I am a beginner in openCV and C++ as well.I am stuck in a particular place while trying to implement face recognition in open cv. I have the stored training images in a folder called data the images of first person is stored like 1_john1.pgm 2nd image of first person … | |
Dear all, I experienced an unexpected error when using getline() to get input from a file like this: a.out < inputFile Part of the code is shown below [CODE] ........ while (true) { cout << "Enter a command: "; getline(cin, input); cout << input << endl; } ......... [/CODE] The … | |
I've been coding in c++ for a while now, and I use string variables quite a lot. One day, I stumbled upon a char* which can also be used to "store" a string of characters, and it's been bothering me ever since that I don't really know what a string … | |
I want to define a vector of TextBox (or any compnents) in VC++ project (windows form). I wrote : [code] std:vector <TextBox^> txt_box; // //then I push the elements back in the vector using txt_box.push_back (textbox1) // //... // for all the text_boxs in my form [/code] but this code … | |
The problem is this. I try to enter the limit of at least 34 fibonacci numbers but the limit display the limit of 89. [CODE]#include <iostream> using namespace std; int main() { int x=0,y=1; int num; cout<<"Enter number:"; cin>>num; cout<<x<<" "<<y; while(y<=num) { x= x + y; y= y + … | |
I've found a simple timer program and it seems to work (for the most part). The problem is that certain cout functions aren't showing up. The timer originally didn't include milliseconds in the code, so I added them myself (which could be the problem) based on the code for the … | |
sample output... ex.1 enter a number: 5 ***** ***** ***** ***** ***** ex2. enter a number: 2 ** ** | |
I have about 50 different tags, each is at most 2 chars in lengnth. depending on the input of the user a combination of tags will be joined together into one large string. Is there a simpler/more efficient way then having 50 different if-statements? for that matter, how is a … | |
1. In a for or while loop, if the condition is breached in the middle of the brackets {}, will the code immediately stop the loop, or wait until it gets to the bottom of the brackets {} ? 2. If a function is called in my code, does the … | |
Help me how i connect a sql server 2005 or ms access database with trubo c++ | |
I'm using DevC++ 4.9.9 and have a problem while I'm debugging: I want to view array C so I will: press F4 and type C. but for my example: if my code is: [CODE]for(i=1;i<=10;i++) for(j=1;j<=10;j++) c[i][j]=10;[/CODE] the left panel (that I saw value) will have 100 line of C. (each … | |
Memory Validator reports a problem: Accessing C++ object functions with a pointer to a deleted object. It is pointing to prefDir = preferredPath; in Loader.h Public: is defined: [CODE] std::vector<std::string> preferredPaths; [/CODE] in Loader.ccp [CODE] CDirLoader::GetFileExtHandle(not related params) std::string prefDir; for(size_t i=0;i<preferredPaths.size();++i) { const std::string& preferredPath=preferredPaths[i]; if (!preferredPath.empty()) prefDir = … | |
Hi I am trying to write something that compiles and runs correctly on both Linux and Windows. I am running bash in Ubuntu on Linux, and I try to set environment variables in the makefile just before the compile lines. I then write something in the code like [CODE] int … | |
Hi, i want to make a own linux os. Does someone know where to get the opensoruce? | |
I'm sorry because I think this is a popular fault but I haven't found why it happened yet. this is a code that has that fault: [CODE] void readfile(){ FILE *f; int u,v; f=fopen(fi,"r"); fscanf(f,"%d%d%d%d",&n,&m,&s,&t); for (int i=1;i++;i<=n) for (int j=1;j++;j<=n) c[i][j]=(i!=j)? Oo:0; for(int i=1;i++;i<=m) fscanf(f,"%d%d%d",&u,&v,&c[u,v]); fclose(f); } [/CODE] when … | |
I am writing a polynomial class but the code I have written to overload the ostream operator<< goes into a infinite loop for the first term. I tried to step through but Visual Studio 2010 goes into linker(?) code instead of only stepping through my code. (How to change the … | |
Hi guys, I need to create two separate applications in C++ , where the first application is a window , and the second application has a button and it needs to close the first window. Both applications must be two separate programs ! [B]I can't use FindWindow()[/B] therefore , I … | |
when I... [CODE]double a = 0.00000001; cout<< a <<endl;[/CODE] The computer outputs 1e-07. I want to force the computer to write it as 0.00000001 thanks! ;) | |
Hi there, I need to change columns to rows and vice-versa. Example: 1001 AA AB AC AD 1002 CC DD EE FF 1003 AA BB CC CC 1004 DD DD DD DD to 1001 1002 1003 1004 AA CC AA DD AB DD BB DD AC EE CC DD AD … | |
Hi, I am writing a code to sort a list of C-strings in a 2-D array. I'm a beginner and it isn't working out. The program crashes every time. After running a bit of testing, I found that the for loop in my sort function is not incrementing the variable … | |
Hi friends, I'm looking for an efficient method to transpose rows and columns from a BIG file. I wrote this code but is very inefficient. In that, I'm closing and opening a file many times. (// #*#) Could anyone help me please? Thanks a lot! [CODE] ifstream testTranspose; testTranspose.open("data.txt"); int … | |
Hi All, We have some problem in calling Peernet TIFF printer. Issue: We want to send TIFF images to Peernet printer and convert them to get new TIFF images. We used ShellExecute functionality to send the TIFF files and create the new TIFF files. But every time, dialog box is … | |
Hi! All.. It is asked that Can a C++ programme be converted to an i-phone app?, by means of any converter or something like that. | |
Hey guys, I'm trying to make an elevator simulator. It shouldn't be anything complex; just a basic 4 story building. Also, the highest level of coding used should just be structures and pointers. I need help as to where I should start. | |
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 … | |
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 … | |
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 … | |
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(); } … | |
[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 … |
The End.