Search:
Type: Posts; User: chibicitiberiu
Search:
Search took 0.02 seconds.
-
August 19th, 2009, 01:30 AM
And I have another strange problem with the debugger and CodeBlocks: I put a breakpoint, press F8 but it doesn't stop there, breakpoints don't have any effect. Neither does the 'Run to cursor'...
-
August 19th, 2009, 01:23 AM
I see the error now, thanks for help.
This is not the final and complete version of the program. I cut some functions and parts so it wouldn't be too long.
-
August 18th, 2009, 06:37 AM
I've just learned to allocate memory dynamically and I got in trouble with a program.
Here is my program:
#include <fstream>
using namespace std;
struct soldatti {
-
March 13th, 2009, 01:33 AM
And wouldn't that do the same job? Instead of verifying every number it first verifies the numbers divisible by two and then the rest of them, it would take the same time.
-
March 13th, 2009, 01:29 AM
Okay, now I tried to test the primes method, but since the limit is 2 billion it generated a file of about 3 megabytes before I forced stopped it after like 3 minutes (it was taking too long) and the...
-
March 11th, 2009, 06:48 AM
This is a really big problem, how do I find the last digit of n at the n-th power?
I did some experiments and this is what I discovered:
Last digit of 1^4=1
Last digit of 2^4=6
Last digit of...
-
March 11th, 2009, 06:24 AM
I did that before sending the source to infoarena.ro, and it fails 3 tests out of 10 because it takes too long.
I need one small improvement, that's all.
And by the way, it needs to calculate...
-
March 11th, 2009, 04:35 AM
Bad idea. I'm limited to 650k of RAM and .1 seconds.
And the restrictions:
* 1 ≤ a ≤ b ≤ 2000000000.
* 0 ≤ b - a ≤ 20000.
So yes, it would take hours to get all prime numbers smaller than...
-
March 10th, 2009, 05:06 AM
That isn't a very good idea either. Reading from files also takes long time, and it's an online competition where I upload the source code and it automatically compiles it and gives the result, it's...
-
March 9th, 2009, 03:40 AM
The program works, but it's just too slow.
Is there any way I can make it faster?
-
March 8th, 2009, 09:57 AM
How to calculate the number of divisors of a number?
The classic algorithm:
for (int i=1;i<n;i++) //or anything similar
if (n%d==0) no++;
is way too slow.
-
March 3rd, 2009, 03:12 AM
Okay I found the issue, it was with the checkocasions(&x, &y) function, I accidentally reversed the x with the y axis at the second diagonal axis, now I reversed that and it works. Now let's see who...
-
March 2nd, 2009, 02:33 PM
I have recently built this game TicTacToe, but I get some bugs with the AI, maybe you can help me.
Here is the source code:
#include <iostream>
#include <stdlib.h>
using namespace std;
...
-
February 18th, 2009, 02:42 PM
Thanks, but this doesn't work in my compiler, it says "Syntax error" at the lines where is declared "bool ...".
Now I have a question... will console programs made in MS Visual Studio (2005) work...
-
February 18th, 2009, 05:16 AM
I now see that I said the wrong thing :D. It doesn't need 'using namespace std;' at the beginning of the program or 'std::' to access functions. What it doesn't have is 'vector', 'string' and other...
-
February 18th, 2009, 05:12 AM
Than how do I do that? I don't really know how to allocate memory, i know very few information about pointers.
How do I know how much memory will this string need?
-
February 18th, 2009, 04:12 AM
It did grow with 1 byte, but not any more since it first writes and then reads, so it dumps the extra byte .
-
February 17th, 2009, 03:02 PM
I found this information in several programming books.
Anyway, how do I make this thing work?
-
February 17th, 2009, 04:57 AM
Declaring 'string' variables in BC3.1 is not supported. I can only use char arrays.
And char* behaves (or at least should) like a string, and unlike arrays should have a big number of characters,...
-
February 17th, 2009, 04:35 AM
Well, this is the copyfile function:
//COPYFILE FUNCTION
//=================
// - Copies a file from the source location to the destination in binary mode
int copyfile(char source[], char...
-
February 17th, 2009, 04:21 AM
Yes, I'm stuck with it. I tried others, but the applications were not working under DOS, only under Windows.
-
February 17th, 2009, 04:20 AM
I'm using Borland C++ for DOS 3.1, and lately I have been having some weird problems with strings. For example, I have a function that copies a file binary
int copyfile(char source[], char...
-
February 17th, 2009, 04:13 AM
Nope, BC 3.1 does not support std:: functions, and "vector" does not exist.
-
February 16th, 2009, 02:27 AM
How do I do that?
Note that I'm using Borland C++ 3.0 (for DOS) and not MS Visual Studio.
-
February 15th, 2009, 08:25 AM
Hillsong - Where we belong
|
Click Here to Expand Forum to Full Width
|