|
we probably aren't seeing the code correctly due to the '<' '>' characters. Also in my browser there is a giant Fish Filet obscuring his post.
led mike
|
|
|
|
|
I guess we use the same browser!
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
hello, I have an project which generate boxes(bin packing) and I want to save the results on the disk so I can use this results in matlab or to save this results in xml so i can use xml for further reaserch please..if you know how can i do this help me .... ...if you can give me some clues...
lavi
|
|
|
|
|
I'd say the first clue would be 'try the visual C++ forum'. It doesn't seem likely from your post that you're using C++/CLI
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 )
|
|
|
|
|
A wild number is a string containing digits and question marks (like 36?1?8). A number X matches a wild number W if they have the same length, and every non-question mark character in X is equal to the character in the same position in W (it means that you can replace a question mark with any digit). For example, 365198 matches the wild number 36?1?8, but 360199, 361028, or 36128 does not. Write a program that reads a wild number W and a number X from input, both of length n, and determines the number of n-digit numbers that match W and are greater than X.
Input (filename: B.in)
There are multiple test cases in the input. Each test case consists of two lines of the same length. The first line contains a wild number W, and the second line contains an integer number X. The length of input lines is between 1 and 10 characters. The last line of input contains a single character #.
Output (Standard Output)
For each test case, write a single line containing the number of n-digit numbers matching W and greater than X (n is the length of W and X).
Sample Input and Output
36?1?8
236428
8?3
910
?
5
#
B.in Standard Output
100
0
4
|
|
|
|
|
If your homework is not for .NET, then you've posted it in the wrong forum. either way, you need to do your own homework, post questions only when you've tried to write it yourself and are stuck on something specific.
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 have a windows form based application, which creates an instance of another class, to which it passes a pointer to itself in the constructor as 'this'. The form has a couple of __property methods, and I'm trying to get the other class to use those methods to push some data back up to the parent form.
For example, let's say my Form1 has a method:
__property void set_MyNumber(int theNumber) {mynumber = theNumber;}
Form1 instantiates another class:
myThing = new CmyOtherClass(this);
Now, down in the other class, I try to access the properties like this:
myParent->MyNumber = 3;
What I get is the following error:
error C2039: 'MyNumber' : is not a member of 'System::Windows::Forms::Form'
I'm fairly sure that the pointers are right, because the following code works fine:
MessageBox::Show(myParent->Width.ToString());
However, it just doesn't seem to recognize the properties I created in the Form1 class. Is there some header or include or using thing that I need to add to make the properties work?
To broaden the question a bit, is this totally the wrong approach? I thought perhaps using delegates might be a better answer, but I seemed to run into similar problems with them as well.
What is the best way to pass information from a subordinate object to its parent?
Thanks for any insight.
_________
. | homas
|
|
|
|
|
Are you passing a 'System::Windows::Forms::Form' pointer to the CmyOtherClass constructor or
a pointer to an object of the type of your Form-derived class?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Mark Salsbery wrote: Are you passing a 'System::Windows::Forms::Form' pointer to the CmyOtherClass constructor or
a pointer to an object of the type of your Form-derived class?
Ahhh, well, the constructor for the other class is like this:
CmyOtherClass::CmyOtherClass(System::Windows::Forms::Form* callingForm)
and back up in Form1, I'm passing 'this' to the constructor of the other class.
I'm inferring from your question that I should have the constructor look for a pointer to a Form1 object, but what's the syntax for that?
(And BTW, thanks for the quick reply )
_________
. | homas
|
|
|
|
|
tcompter wrote: CmyOtherClass::CmyOtherClass(System::Windows::Forms::Form* callingForm)
You'll need to change the constructor to take an object of the type being passed instead of a
'System::Windows::Forms::Form' (the base class) pointer.
Also, if you are storing the passed pointer in a CmyOtherClass member variable, you need to
change its type too.
That way the compiler will know the existence of your properties
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hey thanks a bunch for that, it worked.
_________
. | homas
|
|
|
|
|
Hi, I have an request: I need someone to create article with OpenGL. There is one, but it's very simple and many users have problems with it( me too ). Plz if You can: create a form with OpenGL rendering within and some edits witch will change rendered objects properties( size, color, rotation or something like that). I hope there will be someone who will be able to handle this request. Thanks!
|
|
|
|
|
How about posting this on the Article Requests and Ideas[^] board?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi, I'm using Visual Studio 2005 C++/CLI. I created a dialog box by adding a new windows form item. In the form designer I set the FormBorderStyle property to FIXED DIALOG, the MinimizeBox and MaximizeBox properties to false. The I add two buttons and set their captions to OK and Cancel and their respective design names to buttonOK and buttonCancel. Then I set the AcceptButton property to buttonOK and the CancelButton property to buttonCancel. When I run the app and ShowDialog() the dialog recognizes the Cancel button and the escape key and closes the dialog but the dialog does not recognize the OK button or the enter key. Do you have an idea as to why?
Thanks
Buck
|
|
|
|
|
As long as I can answer my own questions then life is good. It appears that the DialogResult property was not being set for either of my dialog boxes that was exhibiting this behavior. So it was simply a matter of selecting the OK button, then selecting its properties and setting the DialogResult property to OK. The cancel buttons DialogResult for whatever reason seems to be set to Cancel automatically.
Buck
|
|
|
|
|
Hi, I'm using Visual Studio 2005 C++/CLI. I placed a group control on my form and then added 8 radio buttons to the group. The first radio button has TabStop set to true and the rest have the tab stops set to false. When the application runs the tab order seems correct, and when I use the arraow keys to select a radio button the arrow moves from the last radio button back to the first as you would want. The question here is, I can't find any examples of C++/CLI that show how to determine which button was selected. I tried using the first radioButton->TabIndex::get() to no avail. What is the proper way to find out which of a group of radio buttons has been selected?
Thanks
Buck
|
|
|
|
|
I discovered that I can get the checked status of the radio button with radioButton->Checked::get(). So instead of using a case statement to determine the tab index (from DDX) I will use a series of if statements.
Thanks
Buck
|
|
|
|
|
hi i got a problem with sort linklist in c i confuse how to swap the number in linklist basicly i use selection sort and
"top is global variable that store unsorted linklist and i want to make it sorted" how ever icannot make it sort can u guys help me? thanks
void sortQ()
{
myQue *sq,*ft;
sq = top;
myQue *temp;
myQue *min = top;
while((sq != NULL)
{
min = sq;
ft = sq->nextQ;
while(ft != NULL)
{
if(ft->total < min->total)
min = ft;
ft = ft->nextQ;
}
//swap mode on
temp = sq;
sq->nextQ = min->nextQ;
min = temp;
sq = sq->nextQ;
}
}
|
|
|
|
|
arifliminto86 wrote: in c
Then you're in the wrong forum. Try the visual C++ forum. This one is for C++/CLI.
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 tried to build an MFC dll(originally written VC++ 6.0) to VC++2005. I am getting the folloing error Error error C2065: 'abuf' : undeclared identifier.
The code is as follows:
static void
free_biobuf(abuf)
biobuf *abuf;
{
if(abuf == NULL)
return;
free(abuf) ;
}
What should i do..
Regards, Eswari
|
|
|
|
|
You have already asked this question in VC++[^] forum. Which is appropriate for this kind of question. So , continue that thread and don't cross-post.
Prasad
MS MVP - VC++
|
|
|
|
|
double GetInvestmentAmount()
{
Console::Write(L"How much money do you want to invest? ");
String^ input = Console::ReadLine();
double amount = \\ i want to convert the 'input 'into the double type
return amount;
}
how can I convert the " String ^ input" into the double type. Thanks in advance.
I've tried "safe_cast(Console::ReadLine())" and " Covert.ToDouble(*input)" but it just doesn't work ==
|
|
|
|
|
Following code works perfectly fine .
String^ input = Console::ReadLine();
double amount = Convert::ToDouble(input);
Prasad
MS MVP - VC++
|
|
|
|
|
|
Sorry I'm a real beginner in c++. I have tried the above method but it returns a lot of errors when I try to compile it. I am sure I am missing something.
Of note, I am using Win32 Application in Visual Studio 2005.
Could you please make an example with a very simple code that I can compile so that I can understand what I am doing wrong.
Thank you.
|
|
|
|