|
|
hi,
I need a function for string reverse and string concat.
not with strrev and strcat.
a user defined function
can anybody help me in this
|
|
|
|
|
Smells like homework to me. If it's not homework, you should never write your own where a standard version exists. If it is homework, you should try to do it yourself, and post here only when you're stuck. We're not here to do your course for you, most of us have done that already.
If you think about it, both are pretty easy. Think about what they do, how strings are stored in memory, and what is the *only* way that these functions can alter memory to achieve what they need to do.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Can some kind soul tell me how to insert a char imediately after every occurance of another char in a string.
|
|
|
|
|
Isn't there a std::string.replace ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
If you use a CString you can use the Find and Insert methods. If you use a plain old character buffer then you can use a loop to scan every character in the string and memmove to shift the end of the buffer down and just an assignment to stick the new one in.
I think it is best that you figure out the rest of the algorithm for yourself. Good luck with it.
|
|
|
|
|
I think you can do this with a combination of string::find() and string::insert() in a loop
You might also be able to do it with a call to std::transform()
System.IO.Path.IsPathRooted() does not behave as I would expect
|
|
|
|
|
I was planning on doing it in a loop. Basically I need to iterate through a sub-document extracted from an XML file and before every "<" insert a 0x09 i.e. a tab char \t, also ensuring that I am not directly infront of a "
|
|
|
|
|
|
Serialization Primer[^]
-- modified at 12:58 Tuesday 27th March, 2007
why did you delete your question ? are you selfish not to allow people to know what you were looking for ?
|
|
|
|
|
Hi,
I am trying to compile a single dll from several static library projects in VS2005. However as it seems the compiler does not link the .lib libraries to the dll unless they are referenced in the dynamic library project. Is there any way (linker flag?) that I can aggregate several .libs in a dll file without having to reference their classes/functions/vars?
Thanks,
Themis
|
|
|
|
|
Themis wrote: Is there any way (linker flag?) that I can aggregate several .libs in a dll file without having to reference their classes/functions/vars?
if you're not referencing them, why do you want them included in your DLL ??
|
|
|
|
|
to aggregate them in a single "super-DLL" ?
|
|
|
|
|
Yes I want to create a super-DLL that others (apps or dll) can link and refer to its included objects.
However I don't want to merge the several .lib projects into one .dll project to generate my dynamic library as my .libs do not match conceptually, hence I prefer to have them separate in the Solution Explorer. Think of a large base dll with several support projects, like networking, serialization, utilities etc. all merged in a single project_base.dll.
Cheers,
Themis
|
|
|
|
|
add your .LIBs to the Additional Dependencies field in the Linker/Input propoerty page.
then you will need to explicitly export all of the functions and variables from the various .LIBs, from the DLL.
|
|
|
|
|
I have already added the dependencies in the dll properties. However I am not sure what you mean when you say "you will need to explicitly export all of the functions and variables from the various .LIBs, from the DLL".
I export symbols (classes/functions) using dllexport in each project. Do you mean that I have to do anything more in the dll project? The fact is that without referencing a class from the dll project it will not be linked by the linker to the target dll. I am wondering if I can bypass this linker "optimization" and make the linker unconditionally add a class' code in the dll.
Cheers, Themis
|
|
|
|
|
Hi, i want detect any change in desktop area. Like, a new apllication run, desktop wallpaper change, etc
[go to end]
|
|
|
|
|
|
MachineMHK wrote: Hi, i want detect any change in desktop area. Like...desktop wallpaper change, etc
Assuming that SystemParametersInfo() was used to make the change, handle the WM_WININICHANGE message.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi all,
how to get difference between two dates using CDateTimeCtrl ?
venu
|
|
|
|
|
Simple - extract the date / time from the control CDateTimeCtrl::GetTime (...) . You would then have a CTime , SYSTEMTIME , or even a COleDataTime .
CTime has comparison functions you can use.
Iain.
|
|
|
|
|
Put the two times in a COleDateTime object, and get the difference via COleDateTimeSpan .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi everyone,
I'm attempting to write a program that takes command line arguments, reads data in from a file,
and then appropriately searches for certain data or sorts the data for output based on the argument passed.
I am having trouble figuring out how to actually sort the vectors according to the attributes.
the struct is as follows:
<br />
struct Wizard<br />
{<br />
string FirstName;<br />
string LastName;<br />
int Grade;<br />
double WandWeight;<br />
};<br />
The datafile being read from simply has each property separated by a single whitespace character. The vector is declared simply as:
<br />
vector(Wizard) wizVec;<br />
(NOTE: angle braces would not show up in preview, assume they take the place of the round braces in the vector declaration)
Don't ask about the name of the struct, it's my prof's example!
Any suggestions or solutions are appreciated and needed!
Thanks in advance!
|
|
|
|
|
To get < and > to show, you need to check 'Ignore HTML tags' below.
You can write a function object that compares two Wizard objects, and pass that into the sort algorithm.
Here[^] is an article on the subject.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Use std::sort to sort the vector. Add an operator < for your struct to define the sort order or code a predicate function or functor and pass it to std::sort .
Steve
|
|
|
|