|
smsmfe wrote: Yes I do
smsmfe wrote: I just don't know how to get started?!?!
Set carry and quotitent to zero
remove the leftmost digit
divide it by two, taking into account the carry
note down the resulting quotient digit and update the carry
repeat till done
that's what you know but don't know, isn't it?
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Thanks Luc,
Luc Pattyn wrote: divide it by two
Here's the problem. I can't make that division! I'm not sure we understand each other...
Can't you make a simple c-program taking a 31 digit number and divide it by 2? Cause I still don't see how to make a division with such a large number. Sure, I can store it in a byte-array or whatever, but somehow I need to treat the 31-digit as a single unit and not as an array and there simply is no datatype large enough available...
|
|
|
|
|
I have explained to you over and over how to divide an arbitrary length number by two,
assuming the number is stored in a char array.
Now you don't want it in a char array?
How do you want it stored?
What will happen to it next?
What is all this about?
How many more posts do you need to state the problem?
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
You have not explained anything to me that I didn't already know. I have asked a thousand times how to make the division with a number too large to be stored as a single number (int). If you really know how to do it, why don't you show me in code?
I have a 31 digit, currently stored in a character array. You told me to make a function that divides a string by 2. Try to do that and maybe you will realize what the problem is. It's no problem taking a value like 10 and divide it by 2. But a number like 9876543210987654321098765432101 you simply can't divide by 2 in the same way! My problem is that the number needs to be stored in another way than a small number like '100'. Like I said, I got it stored in a character array. But how to make a division on a character array which is a bunch of boxes of single numbers and not a complete number of 31 digits? In theory I know exactly how to make the division, don't bother explain that to me, just show me how to make a division of a character array!
/Martin
-- modified at 3:04 Tuesday 27th November, 2007
|
|
|
|
|
Dear,
How can I use chart object to display statistic data?!
I add reference MS Chart20Lib 2.0 and interop OWC11.1.0
but no components add in tool box.
how can I do it? Who can send me a example code?!
thx.
|
|
|
|
|
Have you looked around on msdn?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
how can I transfer integer Dec to hex
I want to show hex kind in monitor.
like 112 -> 0x70
use sprintf?!
sprintf(str, "%x", data);
textBox1->Text=str;
醬子嗎??!!
|
|
|
|
|
I use this code to do it.
richTextBox1->Text += Conversion::Hex(m_Buffer[j])+" ";
|
|
|
|
|
Hi all,
OK, desperate now - I've been on this for days...
I have a large native C++ mobile project I have just migrated from eVC++ to Visual Studio 2005.
I need to integrate Intermec's RFID library into the project but they only have a managed .NET assembly available.
Is there some way I can 'talk' to this code? Can I create a C# project, incorporate the Intermec stuff, create some entry points and access them, dll style?
I was thinking of migrating my project to managed C++ but it seems this is not available in the Compact Framework.
Any suggestions would be much appreciated.
Regards
Jason
|
|
|
|
|
do you have clr enabled?
If yes, gcroot is you friend. It will allow you to point to a c# dll that you can add to you project.
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
I want do create a modeless (non-modal) Dialog. I have tryed this with ShowDailog(), but this ist modal.
How can I create a modeless Dialog?
|
|
|
|
|
use Show() instead of ShowDialog().
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Yes I know!
The Problem is that the modeless Dailog gets no resources, when the parent dialog is still working:
When I make the following code on the parent dialog, with an endless loop I can not use the modeless dailog. All resources are on the parent dialog
void OnClick()
{
CDia dia*=new CDia();
dia->Show();
do{
// Do some Code
}while(1);
}
|
|
|
|
|
Hi,
strizi wrote: do{
// Do some Code
}while(1);
for proper GUI operation you must limit the amount of work executed on the GUI thread.
If you keep it down to a few dozen milliseconds, the GUI will remain responsive on all
Forms that are visible thru Show() unless there is a ShowDialog() called somewhere.
Hence move your long "do some code" to a separate thread, and let the GUI live.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
i want to make a server on PC and there are few clients who hv the server IP and the server hv clients IP . I want to prepare a project in which one client write a text and the server PC multicast i.e distribute the text or message in to its clients and the message is also stored in the server PC.
|
|
|
|
|
Use more than just "help please" in your subject line. It is incredibly vague.
As far as your request, it is beyond the scope of a reply.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
for some reason the Encoding::ASCII->GetString always returns an empty string. While i was debugging it i verified that the buffer was full with data. in the client, i used this same method to return the string and it returned the data in the buffer (as expected). I'm not sure what i'm doing wrong here
StringBuilder ^sb = gcnew StringBuilder();
NetworkStream ^stream = (NetworkStream^)result->AsyncState;
stream->EndRead(result);
array<Byte> ^buffer = gcnew array<Byte>(1024);
while(stream->DataAvailable) {
int nRead = stream->Read(buffer, 0, 1024);
sb->Append(Encoding::ASCII->GetString(buffer, 0, nRead));
}
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
|
all i am doing there is calling the beginread to listen for any data and when it comes just do an end read and read the data in a loop synchronously. Here is a Screenshot[^] of what i am doing here.
-- modified at 18:00 Monday 19th November, 2007
UPDATE:
Pretty wierd...after troubleshooting it further, i got it to work. before i sent the data on the client side, i converted it to a base64 string and on the server side the encoding function worked. what the piece of data is that i am trying to send through is a serialized object using binaryformatter. I guess the GetString function didn't like the format of the data???
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
how can i prevent the system to switch tasking in a critical section ?
|
|
|
|
|
What in the hell are you talking about?
Is this a .NET question? This forum is for "C++/CLI managed and mixed mode" questions as the title states, as does the top (first) post.
So far it seems you are in the wrong forum and have no idea what you are talking about, hows that working out for you?
|
|
|
|
|
led mike, if you do not know the answer don't replay...
it's very simple
|
|
|
|
|
Gilpaz, if you do not know the answer don't develop software...
it's very simple
|
|
|
|
|
what i'm doing in my life is none of your business
|
|
|
|
|
.NET does not use the term, critical section, but uses the System.Threading.Monitor class. Also, task switching is a very low level system activity. Thus, your post is not appropriate here.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|