Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 25 Oct 2012
Offline Last Active Jan 08 2013 12:54 AM

#5017030 Begining an editor

Posted by aavci on 03 January 2013 - 04:14 AM

64-bit pre-built binaries of Qt for VS2012 is on its way

#5009760 C# creating array of objects and initialize

Posted by aavci on 12 December 2012 - 03:38 AM

You are trying to do the initialization-seperate-from-declaration in the class declaration which is not allowed. You probably should be doing something like this:
[source lang="csharp"]World[] W = new World[10];World[] O = new World[2] { new World(-1.6, 1.6, -1.0, 1.0, function.julia, 500), new World(-0.5, 1.5, 01.25, 1.25, function.mandelbrot, 500) };[/source]
Code not tested.

#4993881 Performance issues in simple program

Posted by aavci on 25 October 2012 - 12:28 PM

Hi. You dont need to calculate all the factors, or check whether they are prime or not. You just need to divide the number starting from 2 until you reach a prime number.
I have written something quickly and it seems to be working.

[source lang="cpp"]#include <stdio.h>int main() { int number; printf("Enter number: "); scanf("%d", &number); for (int i = 2; i < number; ++i) { while (number % i == 0) number /= i; } printf("Biggest prime: %d\n", number); return 0;}[/source]