tux4life 2,072 Postaholic

There must be a simple way to do this ?

Yeah, sure, use structures !

tux4life 2,072 Postaholic

You could also use structures which you read from the file, everytime the program runs, and write the back to the file when the program has finished ...

But you can also use seekg() ...

tux4life 2,072 Postaholic

It doesnt close when i run it

I think he's using Windows (not Linux or Unix or ...)
And in Windows you can just double click on the executable file and it launches, but in his case it will just appear and dissappear directly, if he started it from a console window (what you're doing) it isn't dissappearing ...

So it isn't compiler related ...

tux4life 2,072 Postaholic

Oh, sorry I didn't read your question thoroughly ...

tux4life 2,072 Postaholic

This is an example of a program which will always add the word 'something' at the end of the file:

#include <iostream>
#include <fstream>

using namespace std;

int main() 
{
	fstream filestr;
		
	filestr.open ("test.txt", fstream::app); 
        // 'app' stands for append
	filestr << "something\n";
	filestr.close();
		
       return 0;
}

You can also use this code with numbers ...

Hope this helps !

tux4life 2,072 Postaholic

You can also use while(cin>>something); (where something is a numeric datatype)
This instruction will read numbers until a non-numeric value was given ...

tux4life 2,072 Postaholic

You just have to put the following instructions before return 0; :

cin.ignore();
cin.get();
tux4life 2,072 Postaholic

I think what you mean is RAD (= Rapid Application Development)
Consider using Microsoft Visual C++ or Borland Turbo Explorer ...

There are free editions for both of them ...

tux4life 2,072 Postaholic

Yeah, I just wanted to say that: http://opencv.willowgarage.com/wiki/Welcome

tux4life 2,072 Postaholic

The following link describes in detail how to code edge detection yourself:
http://www.pages.drexel.edu/~weg22/edge.html
And maybe this link is useful too: http://www.intelliproject.net/articles/showArticle/index/image_proc_edge_detect

tux4life 2,072 Postaholic

well integers in java can hold a lot bigger values than that infact if i am not wrong its even bigger than the one allocated in c/c++.
well if u still want bigger values then try using float or double.

And what about an unsigned long ?

tux4life 2,072 Postaholic
int fact(int n)
{
if(n==1)
return 1;
else
return (n*fact(n-1));
}

You can leave out the 'else' and I would like to advice you using another datatype than 'int' as factorials are quickly becoming large numbers (e.g.: the factorial of 10 is: 3.628.800) ...

tux4life 2,072 Postaholic

You should process all pairs of integers and for each pair determine the maximum cycle length over all integers between and including i and j.

What do they actually mean by that ?

tux4life 2,072 Postaholic

In fact it's a very simple program, you only have to use a for loop
(or recursion as I already stated)

You've to make something like a design plan first:

> You get the number where you want to calculate the factorial of from the user (store it in a variable)
> Now you use a for-loop to calculatate the factorial:
- Use for e.g. a for-loop with 'i' as index, you have to set it in such a way that 'i' is always incremented by 1 after a loop has been made ...
- The loop has to run n-times (where 'n' has to be the number where you want to calculate the factorial of)
- Now you declare a temporary variable (called 'result' for instance) and in each step of the for-loop you're multiplying it by 'i' (the index)
( result = result * i; or result *= i; )
- After the loop has finished you've the factorial ...

Note: Factorials are quickly becoming big so it might be useful to use an unsigned long for storing the factorial ...

tux4life 2,072 Postaholic

Check out this ...

tux4life 2,072 Postaholic

I would use a struct called 'intPair' or something ...

With me the struct would look like:

struct intPair
{
	int pair[2];
};

Then you're creating a table of structs: intPair input[3]; (now 'input' will be capable to hold three pairs of integers)

You can access the data like this:

// This example shows you how to set the first pair:

input[0].pair[0] = 10;
input[0].pair[1] = 20;
tux4life 2,072 Postaholic

I actually don't understand your question ...
I think you mean the following, please say if I'm wrong:

-> I want to open a picture in Corel Draw using a program written in Visual Basic ...

Is that what you meant ?

In that case maybe the following information might be helpful for you: http://www.developerfusion.com/article/9/shell-and-shellexecute-function/
But you should adapt it to your needs ...

Hope this helps ...

tux4life 2,072 Postaholic

We can't just give you some code away, sure we can solve this, but it's your homework ...
You should first show what you've done so far, and if you get stuck, you post your code and ask specific questions about it ...
In fact you could use a simple for-loop, but you could make your code even shorter by using recursion (recursion means that a function is calling himself ...)

tux4life 2,072 Postaholic

On line 13, 16, 21 (of your function 'MultiSearc', code posted below) you're trying to access 'MyArray', but you aren't giving any subscript with it ...
You should add a counter to your loop and access the data in 'MyArray' using MyArray[counter] ...

I reposted your code:

void dSearch::MultiSearc(int MyFindItem, int MySize)
{
    int center, left, right;
    int indexes[MaxFound] = {{0}};
    char status[8] = "Failed";
    *indexes = -1;
    left = 0;
    right= MySize - 1;

    while (( left <= right) && (strcmp (status, "Failed") ==0))
    {
        center = ( left + right )/2;
        if ( MyArray == MyFindItem)
        {
			*indexes = center;
			if (MyArray == MyFindItem)
			{
				*indexes = left;
				strcpy ( status, "Success....!");
			}
			else if (MyArray  > MyFindItem)
				right = center -1;
			else
				left = center +1;
        }
    }
}

Hope this helps !

tux4life 2,072 Postaholic

OK, in that case you are absolutely right !:)

tux4life 2,072 Postaholic

Maybe you should post another source, which also isn't compiling under Solaris, but which you aren't using in your project ...

tux4life 2,072 Postaholic

It's apparently a heat problem ...
Consider installing some extra coolers into your computer ...

You'll also have to remove that exploit from your computer ...
Maybe you should also try using another antispyware like Spybot S&D or Ad-aware Free ?

tux4life 2,072 Postaholic

I'm just using CString variables wherein it holds the data.
How can I clear the value of a variable? I'm just using = ""; (ex. translated = ""; ). Is it enough to clear the memory?

It's only clearing the value of a variable, it's not releasing the assigned memory ...

tux4life 2,072 Postaholic

I have recovery disks and used them to restore the system to company state.
But then also after some time, problem arises.

Rather looks like a hardware problem ...
> Consider running a diagnostic memory test/hard drive test ...

tux4life 2,072 Postaholic

Do they all have the same subnetmasker (usually '255.255.255.0') ?

tux4life 2,072 Postaholic

Normally you cannot use DELL Recovery CD's on other computer systems than DELL systems, as DELL verifies it
(something with an OEM-BIOS) ...

But normally you can buy a new recovery cd from HP ...

tux4life 2,072 Postaholic

> Question:

Hi there Tabarak, Do you have your Windows Vista disc?

> Answer:

i dont even have the recovery discs...

If Vista came pre-installed on your laptop and no recovery disk(s) came with it, there might be a recovery partition somewhere on your hard disk ...

tux4life 2,072 Postaholic

What do you mean with 'Desktop Icons won't load correctly' ?
> Do you mean that the program's shortcuts have wrong icons ?

Maybe this link is useful for you ...

tux4life 2,072 Postaholic

Yeah, I also agree with MrSpigot, you should consider to use an alternative design for your program as it will be really difficult and error-prone to do what you're asking for ...

tux4life 2,072 Postaholic

Hello mimis, I've written a snippet to add two big integers ...
You can find it here ...

Hope this helps !

iamthwee commented: Yeah but you're still doing his homework. -4
tux4life 2,072 Postaholic

I've written a C++ class to estimate the roots of a number: you can check it out here ...

Maybe the following page might be helpful too:
http://en.wikipedia.org/wiki/Methods_of_computing_square_roots

Hope this helps !

tux4life 2,072 Postaholic

Example of a For-loop:

for(int i = 0; i < 3; i++)
{
    /* This loop will repeat 3 times */
}
tux4life 2,072 Postaholic

Can your computer read other CD's?

You didn't give me an answer to that question ...

tux4life 2,072 Postaholic

need help with a c++ problem

I think that was logic, but what's 'a' problem, we have to know what problem ...

In this case he has problems with some existing code ...

tux4life 2,072 Postaholic

Ok, I know using an array is (a little) waste of memory, but if you do a quick math sum:
> 1MB = 1024 * 1024 Bytes = 1048576 Bytes
> An integer is maximum 4 bytes
> So, 1048576/4 = 262144
> Which means that in 1MB computer memory you can store a number of 262144 digits ...
> And today most computers have (I hope so) much more than 1MB RAM ...

It's a little waste of space, but much easier to code ...
If you really want to use your computer memory as efficient as possible you should work with strings (but it will be more difficult to code, but it is do-able) ...

tux4life 2,072 Postaholic

You could also represent a big integer in an array, where each element represents a digit of the number ...

E.g: int bigint[12] = {1,5,6,9,7,2,3,4,5,1,0,2}; (which represents number 156972345102)

I think it's much easier to program if you use this method ...

tux4life 2,072 Postaholic

Mmm, did you make a plan before writing your program ?
As you're writing an algorithm this is a very important thing to do ...
You have to describe step by step how YOU would do it, afterwards it's much simpler to code the algorithm, and you would also make less mistakes ...

tux4life 2,072 Postaholic

What's your computer vendor?
Did Windows came pre-installed with your pc, in that case it came probably also with a recovery cd or a recovery partition (somewhere on your harddisk) ...

Consider looking it ('it' means 'how you have to restore your pc to the state in which it was bought') up in the support information of your computer, most computer vendors are hosting documentation on their sites so that can't be a big problem ...

tux4life 2,072 Postaholic

In that case you'll have to implement your own algorithm ...
You can maybe try to implement the following:

When you do math and you have to make the sum of two big numbers, without using a calculator ...
What do you do ??

Well, you just sum up each digit with the corresponding digit of the other number ...

To give you an idea of what I mean:
Let's say you want to make the sum of 361 and 221, in that case you do the following:

|| 3 6 1
|| 2 2 1
= 5 8 2

You could also adapt this algorithm to your needs and use it with very big integers ...

You have analog algorithms for multiplying and dividing numbers ...

You could store the big numbers for e.g. in a string and convert it digit by digit, sum up the two digits and add the result each time to another string which holds the answer of the calculation ...

To hide all these operations it would be nice to implement your own class ...

Hope this helps !!

tux4life 2,072 Postaholic

Hasn't there to be a 'while' after the '}' on line 33 ?
I don't know any C++ statement with only 'do', it think you meant the 'do while' ...

e.g.:

do
{
    /* Your code here */
} while ( <condition> )
tux4life 2,072 Postaholic

However, I assume his computer is powerful enough to run AVG, as he's installing Norton on it ...

Actually you could check if your computer can run any AV, just try Norton, if that works, the other AVs will also work ...;)

tux4life 2,072 Postaholic

hello ppl
im new to C++
i was making a small newbie math quiz..
and was wandering how can i make it that at the end it says how much u got out of 10 or watever

Make use of a variable 'points' for instance and increase it by one every time a right answer has been given ...

This information about variables might be helpful ...

By the way I got Dev C++
if anyone knows of a better one please say so

I would use Code::Blocks instead (reason: Dev-C++ isn't being developed anymore (there are still some bugs in it), Code::Blocks is more advanced and up-to-date ...), but since you're a newbie programmer Dev-C++ will still fit your needs ...

tux4life 2,072 Postaholic

Maybe you should check out the Ultimate Boot CD (which is probably useful in situations like this one): http://www.ultimatebootcd.com/download.html

tux4life 2,072 Postaholic

Please check out the following C++ libraries:

> http://mattmccutchen.net/bigint/
> http://sourceforge.net/projects/cpp-bigint/

Ancient Dragon commented: nice links :) +36
tux4life 2,072 Postaholic

Yeah, we aren't writing programs for you, you first have to show some effort, post the code you already have ...

And if you don't know where to start then do the following: break the problem down into little parts which are simple to solve, then you put everything together and the big problem is solved ...
(this process is also known as abstraction)

tux4life 2,072 Postaholic

OK, thank you very much for all your help, time, and useful advices ...

tux4life 2,072 Postaholic

Did you try a Windows repair install ?
See this page for available Windows XP Repair possibilities you could try ...

tux4life 2,072 Postaholic

You could also search for "windows 2008 server" on www.ebookee.com (the best resource for free ebooks about IT) ...

Probably not legal, but it's an answer to your question ...

! DO THIS ON/AT (which preposition do I use here ?) YOUR OWN RISK !

tux4life 2,072 Postaholic

And what about this ?

I know it doesn't explain you how to set up a server (for that purpose you need to buy a book, but it's just giving some general information on Windows 2008 Server)

BTW, Sorry if my English is bad !

tux4life 2,072 Postaholic

Maybe you should buy a book from Microsoft Press about that topic ...