|
The truth is that i got the question as homework
But i'm not at all familiar with any languages
all I'v learned is the basics
so i went totally blank on seeing this question
so if u could kindly help me out.....
please do if u could.
|
|
|
|
|
MaddySays wrote: But i'm not at all familiar with any languages
Well, then why are you getting this homework assigned to you?
MaddySays wrote: so i went totally blank on seeing this question
The first step is to break it down. No single line of code will do all of this, so think about the various parts and how they need to work in order to come together to make the whole.
And, unless you're using C++/CLI ( C++ with .NET ), ask in the right forum when you're able to ask specific questions.
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 )
|
|
|
|
|
Sorry to ask but which forum should i ask if it is totally based on c++ alone??
|
|
|
|
|
The visual c++ forum.
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 )
|
|
|
|
|
I want to add a "-" to an existing string:
char* sOutString = new char[stringSize];
strcat( sOutString, "-" ); // Results in Warning
but use the new function to avoid the deprecation warning:
strcat_s( sOutString, stringSize, "-" );
But, this is apperently not correct as it crashes on this line. What am I doing wrong and how to I fix it?
EDIT: The above does work... I just did something wrong. All working now. Thx.
|
|
|
|
|
Your core problem is that you're using C. If you're using C++, use the string class. If you're using C++/CLI, consider the String class. Either way, this question is about C or C++, and this is the C++/CLI forum
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 )
|
|
|
|
|
Hi,
I have a function for comaring.
int DataPeakCompareFunc(const void *el1, const void *el2)
{
const DataPeak *peak1 = reinterpret_cast<const datapeak="" *="">(el1);
const DataPeak *peak2 = reinterpret_cast<const datapeak="" *="">(el2);
if (peak1->position < peak2->position)
{
return -1;
}
else if (peak2->position < peak1->position)
{
return 1;
}
return 0;
}
this is my qsort function
int (FConvert::OConvevw::*pt2Function) (const void*, const void*) = NULL;
pt2Function = &FConvert::OConvevw::DataPeakCompareFunc;
qsort((void*)pScan, num_readings, sizeof(DataPeak),pt2Function);
But i am getting this error
Error 206 error C2665: 'qsort' : none of the 2 overloads could convert all the argument types d:\cougar_io_development\cougar\core\libraries\cplusplus\dlls\fconvert\OConvevw.h 789
both are residing in oconvevw.h file only.
What to do?
Thanks in advance.
Regards, Eswari
|
|
|
|
|
may be this is the wrong forum to ask.. But i could not see any C++ category.
That's why i posted here
|
|
|
|
|
Yes, this is the wrong forum. See your post here[^] on the correct forum
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I am using /clr compiler flag. I am getting these errors while compiling my code.
1.
Error 1 error LNK2028: unresolved token (0A00098C) "int __cdecl GetXcaliburDataPath(class ATL::CStringT<wchar_t,class strtraitmfc_dll<wchar_t,class="" atl::chtraitscrt<wchar_t=""> > > &)" (?GetXcaliburDataPath@@$$FYAHAAV?$CStringT@_WV?$StrTraitMFC_DLL@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@@Z) referenced in function "public: __clrcall FConvert::FConvertClass::FConvertClass(struct FConvert::FConvertRecord ^)" (??0FConvertClass@FConvert@@$$FQ$AAM@P$AAUFConvertRecord@1@@Z) FConvert.obj
2.Error 2 error LNK2019: unresolved external symbol "int __cdecl GetXcaliburDataPath(class ATL::CStringT<wchar_t,class strtraitmfc_dll<wchar_t,class="" atl::chtraitscrt<wchar_t=""> > > &)" (?GetXcaliburDataPath@@$$FYAHAAV?$CStringT@_WV?$StrTraitMFC_DLL@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@@Z) referenced in function "public: __clrcall FConvert::FConvertClass::FConvertClass(struct FConvert::FConvertRecord ^)" (??0FConvertClass@FConvert@@$$FQ$AAM@P$AAUFConvertRecord@1@@Z) FConvert.obj
Any help is appreciated.
Thanks, Eswari
|
|
|
|
|
These are linker (not compiler) errors. In your project, ou need to include the file which
contains the implementation of GetXcaliburDataPath(). If it's in an external DLL you need to add
the link library (.lib) file. If it's in one of your source files (.cpp) then make sure that
file is in your project and the linker can find the .obj file for it.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I figured it out. Thanks anyway.
Regards, Eswari
|
|
|
|
|
Hello,
at the moment I'm searching some logging possibility that I can use in .net and in native c++. For pure .net implementation I have used until now the Enterprise logging application block. But for the native c++ application I don't cant use this, because in this parts I really need a fast solution.
Does anyone now a solution that works in booth managed and unmanaged parts and is also fast?
Best regards
Hansjörg
|
|
|
|
|
Develop a simple WIN32 dll - Use it from both unmanaged and managed worlds.
Cheers,
Suresh
|
|
|
|
|
Helo...I have my inteface in c++ and I want to take the data from the interface in the main program like this:
int main(array ^args)
{
// Enabling Windows XP visual effects before any controls are created
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
// Create the main window and run it
Application::Run(gcnew Form1());
int container = Convert::ToInt32(forminterface::Form1::ContainerWidthtextBox::...., System::Globalization::CultureInfo::CurrentCulture);.........}
in the interface I have a TextBox...ContainerWidthtextBox in which I introduce the data ...how can I use this value in my main ....because it doesn't let me to use:
int container = Convert::ToInt32(forminterface::Form1::ContainerWidthtextBox->Text, System::Globalization::CultureInfo::CurrentCulture);
it give me an error like Error 5 error C2227: left of '->Text' must point to class/struct/union/generic type please help me.......
lavi
|
|
|
|
|
Please help me...how can I get a value in main from my interface....it's a method?...I am disperate..I must solve this...
|
|
|
|
|
Following snippet should give you some idea about usage.
TestForm::Form1^ myform = gcnew Form1();
Application::Run(myform);
MessageBox::Show(myform->textBox1->Text);
-- modified at 5:25 Wednesday 16th May, 2007
Probably, you need better alternative. But, you was facing problem, because, of using object in wrong way, infact, I guess, edit box variable was not recognized by compiler.
Prasad
MS MVP - VC++
|
|
|
|
|
It seems to me Prasad had it right...you need an actual object to access its "Text" property:
Form1^pForm1 = gcnew Form1()
Application::Run(pForm1);
int container = Convert::ToInt32(pForm1->Text, ...);
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
thanks .....I solved the problem
|
|
|
|
|
|
I’m converting an old MFC program to Windows Forms. In one function there is a TIMESTAMP_STRUCT type. That is defince in an MFC library function (afxdb.h).
I can’t find a replacement for this library. Any leads to locating a way to replace this would be very helpful.
Thanks
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
TIMESTAMP_STRUCT is an ODBC type defined in sqltypes.h.
It looks pretty similar to a Windows SYSTEMTIME structure or a .NET System.DateTime struct.
Are you looking for a database class/framework replacement or just for the time struct?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I think this will work. Thanks
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
Right now I'm creating a program that declares a structure, which also has enum inside it. Now I believe I declare the structure right, but the next step is to create a loop that has the user enter 5 different items of data for library information. But I have to use pointers, so when the loop runs and I enter the information, the data has to be sent to a structure variable only once all six attributes are entered, and the pointer values should be used to create the structure.
I was given an example:
cin >> a;
cin >> b;
library.dewey = &aptr;
This is my code so far:
struct card_catalogue<br />
{ <br />
float dewey;<br />
string title;<br />
string author;<br />
int released;<br />
int num_pages;<br />
enum type {fiction = 1, non-fiction, reference, pond};<br />
};<br />
<br />
int main()<br />
{<br />
return 0;<br />
}<br />
|
|
|
|
|
Why would you post this question in the C++/CLI forum? I would think being able to 'read' would be a prerequisite for whatever course this assignment is from.
led mike
|
|
|
|