No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
8 Posted Topics
Hi, I want to know when and where is memory allocated for static variables. If: 1) static variable is in a function 2) static variable is a member of a class 3) a global static variable inside a file of code. Much appreciated. Google hasn't been much of a friend … | |
I am not sure if the title of my thread indicates where the problem is, but that is what I think it is. [code] void convertFormat(vector<string>& files, map<string,int>& tickerMap, vector<int>& numRecords ) { string txt = ".txt"; string filePathNameString; for ( int k =0 ; k < (int)files.size(); k++) { … | |
[code] vector<int> vi(3); for (int i=0; i<vi.size(); i++) { cout << vi[i] << endl; } [/code] output1: 0 0 0 [code] vector<int *> vi(3); for (int i=0; i<vi.size(); i++) { cout << vi[i] << endl; } [/code] output2: 0 0 0 [code] vector<int *> vi(3); for (int i=0; i<vi.size(); i++) … | |
Sorry for a duplicate post. The other post had gotten messy and since I was not allowed to delete it, I am starting a new post. Hi, here are the errors I am getting when i compile on cygwin. It is weird that the code compiles and runs perfectly on … | |
Re: I use vectors. Here's a way to do it: [code] void computeProduct(vector<vector<double> >&x,vector<vector<double> >&y,vector<vector<double> >& prod) { double sum =0; for(int i=0; i<(int)prod.size(); i++) { for(int j=0; j<(int)prod[0].size(); j++) { for(int k=0; k<(int)x[0].size(); k++) sum += x[i][k]*y[k][j]; prod[i][j]=sum; sum = 0; } } } [/code] | |
Hi, here are the errors I am getting when i compile on cygwin. It is weird that the code compiles and runs perfectly on Visual Studio. $ g++ -o mainUnix.out mainUnix.cpp [code]mainUnix.cpp: In function `int main()': mainUnix.cpp:47: error: expected primary-expression before numeric constant mainUnix.cpp:47: error: expected `;' before numeric constant … | |
I wrote a program to solve a system of linear equations. It works fine with the VS compiler. But when I try to run it using Cygwin, I get a seg fault(core dumped). But it does not say where the seg fault is. I am using the following commands: to … | |
#include <iostream> #include <sstream> #include <fstream> #include <vector> #include <string> using namespace std; class PriceFeed { public: PriceFeed(vector<string>& tickers) { // init(tickers); } } int main () { vector<string> tickers; tickers.push_back("AAPL"); tickers.push_back("XOM"); //PriceFeed(tickers); PriceFeed pf = new PriceFeed(tickers); [COLOR="Red"]// Error on this line[/COLOR] system("pause"); //return 0; } Can you please … |
The End.