jaskij 45 Junior Poster in Training

As for IDEs, you might try Orwell Dev-Cpp ( http://sourceforge.net/projects/orwelldevcpp/ )- this is the one most of my friends started out with, and it has seen some updates recently, like un up-to-date compiler ;P

If you need some pre-made tasks, try some online solving system, like http://www.spoj.pl/

DeanMSands3 commented: Bravo, sir. It's as if an old friend was dead and has returned to me. +4
jaskij 45 Junior Poster in Training

1. #include <typeinfo> and typeid() http://en.wikipedia.org/wiki/Typeid

3. I tend to be wrong recently, but IMO an empty template parameter would incur a compile error.

triumphost commented: You're right! +6
jaskij 45 Junior Poster in Training

Ancient Dragon: there is actually a new version of Dev-C++, although not by Bloodshed. It contains MinGW GCC 4.6.2, so it should support most of the features even for C++11 ;)

http://sourceforge.net/projects/orwelldevcpp/

Ancient Dragon commented: Thanks. I didn't know that. +17
jaskij 45 Junior Poster in Training

Also, a word of warning if you are using MS Visual Studio:

VS has a lot of runtime checks built in their debug implementation of STL, so if you run it under debug it will most likely feel terribly slow.

In my case it came out when I wrote a simple app to render Mandelbrot and Julia sets. The difference was immense. In debug, it would take a fair amount of time to render with around 16 iterations, while in release it would be faster even at around 60-70 iterations.

jaskij 45 Junior Poster in Training

Sorry if this has been posted before:

SPOJ especially tutorial problems.

It can a bit challenging, since most problems are demanding algorithmically and SPOJ judges (yes, software ones) are pretty strict on I/O, but it is also pretty much fun.

jaskij 45 Junior Poster in Training

This here is a code of my recent uni assignment to render Mandelbrot, Julia and Burning Ship sets, using SDL.
The code works properly, using MS Visual Studio 2010 Premium, but displays some errors (either numerical or type casting differences, I couldn't find them) after porting to Linux and compiling using g++.
If you compile it under VS and it runs slowly, try compiling it in release configuration instead of debug, as VS has quite a bit of run-time checks built into debugging versions of STL.
Also, the first idea was to store the rendered SDL_Surface internally, but I ran out of time to implement that :/
And I suppose you could optimize it somehow too, anyways I am putting it here mostly to ask other members of DaniWeb to evaluate it, and if someone finds it helpful, all the better :)

#include <vector>
#include <algorithm>
#include <complex>
#include <cmath>
#include "SDL/SDL.h"

namespace fractal{
	//	typedefs
	typedef enum {MANDEL=0, JULIA=1, SHIP=2} fractType;

	//	constants
	const int MODE_COUNT=3;

	//	a bit ugly, but shortens the code and such
	//	order as in modeType
	const int RES_W[MODE_COUNT]={400,300,400};
	const int RES_H[MODE_COUNT]={250,300,250};
	const double MIN_RE[MODE_COUNT]={-2.5,-2,-2.5};
	const double MAX_RE[MODE_COUNT]={1.5,2,1.5};
	const double MIN_IM[MODE_COUNT]={-1.25,-2,-1.75};
	const double MAX_IM[MODE_COUNT]={1.25,2,0.75};

	//	histogram
	class Histogram{
	private:
		static const int BPP=32;
		static const unsigned char COLOR_R=0x24;
		static const unsigned char COLOR_G=0xb0;
		static const unsigned char COLOR_B=0x15;
		fractType type;
		static int iters;
		int width,height;
		long double top, left,bottom, right;
		std::vector<std::vector<long double> > hist;
		bool validHist,validSurf;
		void init();
		void …
DeanMSands3 commented: Rock on! +3
jaskij 45 Junior Poster in Training

Expected something of the kind.

I suppose telling you what the docs say will not help you, but they mention SIGSEGV after getting a null font.

txwooley commented: Thanks for the help. +3
jaskij 45 Junior Poster in Training

That's because of what you did in line 12.
Why?

int feet ; 0

Should be

int feet=0;

In general, all your variable declarations are wrong. While constants are correct.
After fixing all the variable declarations compiled properly using g++ -Wall The final code is like this:

#include <iostream>
#include <cmath>
#include <string>
 
using namespace std;
 
int main()
{
	const double feet_to_inch = 12; // conversion from feet to inches
	const double inch_to_centi = 2.54; // conversion from inches to centimenters
	 
	int feet= 0;
	double inches = 0.0;
	double total_inches = 0.0 ;
	double centimeters = 0.0;
	 
	// Conversion Program to centimeters
	cout << "The quieter you become, the more you will be able to hear";
	 
	// Entered value by user in feet
	cout << "\n Enter in feet" ;
	cin >> feet ;
	 
	// Entered value by user in inches
	cout << "\n Enter in inches" ;
	cin >> inches ;
	 
	//Calculate number of inches
	total_inches = inches + feet * feet_to_inch ;
	 
	// Convert to centimeters
	centimeters = total_inches * inch_to_centi ;
	 
	// Output results
	cout << "/n The Result is :" << centimeters;
	 
	char c;
	cout << "/n Press anything to Exit" ;
	cin >> c;
	 
	return 0;
 
}
seanster138 commented: thank you so much, i learnt something new thanks to you +0
jaskij 45 Junior Poster in Training

1. Please don't make such ugly one-liners like lines #14 and #33

2. I don't know, if this helps, but x definitely goes into negatives, which might cause your factorial function to do strange things.

Ancient Dragon commented: yes :) +17