L
Leo jay
following code is supposed to output 1, but in my vs2005, the output is
0.
if i change the "ends_with(str, sz)" into "ends_with(str, string(sz))",
the output is correct.
i wonder why. is there any difference between these two statement?
thanks.
// boosttest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <boost/algorithm/string.hpp>
#include <string>
#include <iostream>
using namespace boost;
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
char sz[1024] = "test.bat";
string str("C:\\test.bat");
cout << ends_with(str, sz) << endl;
return 0;
}
0.
if i change the "ends_with(str, sz)" into "ends_with(str, string(sz))",
the output is correct.
i wonder why. is there any difference between these two statement?
thanks.
// boosttest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <boost/algorithm/string.hpp>
#include <string>
#include <iostream>
using namespace boost;
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
char sz[1024] = "test.bat";
string str("C:\\test.bat");
cout << ends_with(str, sz) << endl;
return 0;
}