Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 days ago.
Improve this question
int** InputMatrix( ifstream& fin, int& rows, int& cols)
This function will take size of matrix from file, create a matrix dynamically,
take matrix elements from file and return the matrix created.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
vector<char> vec;
vec.push_back(0x1);
char* a = "qwe";
I want to push a to the end of the vector.
You can use the .insert() member function with pointers standing in as iterators.
vec.insert(vec.end(), a, a+strlen(a));
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to compare between two faces using openCV , how can I do that ?
Comparing between 2 images can be done by accessing each pixels and taking the difference or use the absolutedifference () to compare the two frames
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have a matrix in one class. That matrix is allocated dinamically, I want to encapsulate it.
Here is my matrix declaration in the Header file:
float** matrix;
And here is the declaration of get method:
float *getMatrix();
Is everything correct so far?
I don't know how to work with pointers in that case. How would the get function look like?
if you want just to return matrix you should use
float** getMatrix();
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a file like:
a [able%5:00:00:capable:00] [able] capable
a [abnormal%3:00:00::] [abnormal]
a [absent%3:00:00::] [absent]
a [absolute%3:00:00::] [absolute] perfect or complete
a [abstract%3:00:00::] [abstract] existing only in the mind
a [abundant%3:00:00::] [abundant] plentiful
I want to get first column "avle", "abnormal" etc to my object. How to crop them and how storage them?
Use the string tokenizer, the best/easiest way to split a line into different variables.
char* word = strtok(line," [%:]");
char* word2 = strtok(0," [%:]");
int value = strtoi(strtok(0," [%:]"));
to store there is a vector container, but there can be used any type of arrays, what is more convenient
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I found implementation using 2D array http://www.geeksforgeeks.org/dynamic-programming-set-10-0-1-knapsack-problem/. But how to implement it using 1D array and if it is not possible then why?
Note that each of values in the current row uses only elements of the current and previous rows. Hence you can implement the algorithm with an array K[2][W], which is the same as using an array K[2*W] with some additional trivial index calculations