Solved the problem myself, by adding the declaration outside the class and before main() like this..
If we miss this, the function is not visible inside sort()
---------- Post updated 03-19-12 at 03:53 PM ---------- Previous update was 03-18-12 at 07:33 PM ----------
Can anyone help me to convert the above program to a template version? I am getting stuck in converting the function pointer 'comp', predicate function of sort() as a template. I am getting undefined reference.
---------- Post updated 03-20-12 at 11:24 AM ---------- Previous update was 03-19-12 at 03:53 PM ----------
In the following program why my std::find() algorithm is not able to search for the vector container element (7,9) though it is present there?
How to correct it?
Last edited by royalibrahim; 03-19-2012 at 02:24 AM..
Hi
I want both standard output and standard error of my command cmd to go to the same file log.txt. please let me know the best commandline to do this.
Thanks (2 Replies)
Hi,
here is my perl script.This script creates an array and is sorting it using the in-built sort function in perl.
#!/usr/local/bin/perl
my number=6;
my @num_arr=(1,2,3,4,5);
my @array=(23,"$number","Hello",2.345,@num_arr);
#printing the array
print... (2 Replies)
Hello all
Im using CC: Sun C++ 5.6 2004/07/15 and using the -library=stlport4 when linkning im getting
The fallowing error :
Undefined first referenced
symbol in file
std::ostream &std::ostream::operator<<(std::ios_base&(*)(std::ios_base&))... (0 Replies)
Hi,
I have a base class and derived a class from the base class, i want to print & read the data for the object created for the derived class,so i have overloaded both the << and >> operators and also have done the foward declaration.
Below is the code snippet,
#include <iostream>
class... (3 Replies)
Hi,
I use the following command
make all > output-`date +%F-%H-%M-%S`.txt 2>&1
to invoke a MAKE process that takes some weeks to complete. The ouput is redirected to a text file. Now I prefix the above command with time to get time needed for completion of the MAKE process
time make... (2 Replies)
Hi
I my code i have following statement
std::istrstream *m_poIstream;
when i compile with xlC_r verison 8 compiler throws following error
: 1540-0063 (S) The text "*" is unexpected.*
Any idea/pointers
from
nayeem khan (0 Replies)
1. The problem statement, all variables and given/known data:
To sort a data
2. Relevant commands, code, scripts, algorithms:
The data provided is saved in dummy.txt and provided in LIBSVM format, but I think this information is redundant..
+1 1:2 2:4 4:3.2
-1 2:2.1 2:2.1 ... (4 Replies)
Recently, I updated the unit I am running applications on with a new CODEC and amplifier; the older parts are EOL. There was a bug with the old setup. For some reason, even when a tone was not being generated, you could hear a noise emanating from the speaker when the LCD brightness was on a higher... (2 Replies)