Be a Supporter!
gumOnShoe
gumOnShoe
  • Member since: May. 29, 2004
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to C++: Main Sep. 19th, 2008 @ 12:26 AM Reply

The c++ faq lite is kind of like the bible to c++ programming. I'm surprised to not see it here.


Newgrounds Anthology? 20,000 Word Max. [Submit]

Music? Click Sig:

BBS Signature
Bapabooiee
Bapabooiee
  • Member since: Aug. 14, 2004
  • Offline.
Forum Stats
Member
Level 12
Programmer
Response to C++: Main Dec. 27th, 2008 @ 08:24 PM Reply

At 5/14/06 07:21 AM, FlashStation wrote: It seems to me that only a handful of users on NG only code with C++, come on guys, there has to be more.

Yeah =[ every time I visit this forum, I pretty much only see PHP threads, with a side of confused Flash scripters =[

StaliN98
StaliN98
  • Member since: Jul. 27, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to C++: Main Jan. 11th, 2009 @ 08:24 AM Reply

This needs an update page.

Jon-86
Jon-86
  • Member since: Jan. 30, 2007
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to C++: Main Jan. 11th, 2009 @ 08:55 AM Reply

At 1/11/09 08:24 AM, StaliN98 wrote: This needs an update page.

Unless your gonna post that update dont bump the topic!


PHP Main :: C++ Main :: Java Main :: Vorsprung durch Technik
irc.freenode.net #ngprogramming

BBS Signature
schach
schach
  • Member since: Sep. 7, 2009
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to C++: Main Sep. 7th, 2009 @ 03:12 PM Reply

I use the GNU C compiler (from the GNU compiler collection). Good editors are gVim, codeblocks, and Dev Bloodshed. Vim is a general purpose editor while codeblocks and bloodshed are geared specifically for C/C++. For just fooling around with C I'd recommend codeblocks.

kingdarkeyes
kingdarkeyes
  • Member since: Oct. 21, 2006
  • Offline.
Forum Stats
Member
Level 07
Game Developer
Response to C++: Main Sep. 7th, 2009 @ 11:25 PM Reply

Classes: What you didn't know
Howdy thar, I finally contributed something :)


Derp

imdead597
imdead597
  • Member since: Jan. 24, 2009
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to C++: Main Sep. 13th, 2009 @ 07:44 PM Reply

C++: Simple GUI

http://www.newgrounds.com/bbs/topic/1104 281

Porkchop
Porkchop
  • Member since: Mar. 10, 2008
  • Offline.
Forum Stats
Member
Level 23
Art Lover
Response to C++: Main Oct. 29th, 2009 @ 09:06 PM Reply

Hey C++. i've got a question with decimals. I'm just starting out with C++ and i'm trying to code a program that will calculate simple interest.

The Simple interest equation is I = PRT
I = Interest
P = Principal (starting amount)
R = Interest rate (percentage)
T = Time in years.

Interest rate has to be a decimal number when it's being calculated. For example, if I had 5.4% interest, i'd have to plug it into a calculator as 0.054.

How can I change the output to put decimal places in so I dont have to have a user input it as a decimal?


[WWE Fans][XBL: PissedMexicans][Toonami Aftermath]

BBS Signature
Porkchop
Porkchop
  • Member since: Mar. 10, 2008
  • Offline.
Forum Stats
Member
Level 23
Art Lover
Response to C++: Main Oct. 30th, 2009 @ 10:42 AM Reply

This is my code, if my previous post was unclear.

// Financial calculator

#include <iostream>
using namespace std;

int main()
{
long Interest, Principal, Time;
float Rate;

cout << "What was the principal payment?" << endl;
cin >> Principal;

cout << "What's the interest rate?" << endl;
cin >> Rate;

cout << "How many years?" << endl;
cin >> Time;

Interest = Principal * Rate * Time;

cout << "The amount of interest you'll have earned will be $"<< Interest << endl << endl;

system("PAUSE");
return 0;
}

For a test input I enter the Principal as $4500, the Rate as 9.5%, and the Time at 6 yrs. The outcome is $256500. Is there a way for me to change the output from $256500 to $2565.00?


[WWE Fans][XBL: PissedMexicans][Toonami Aftermath]

BBS Signature
thingie-348
thingie-348
  • Member since: Nov. 27, 2005
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to C++: Main Oct. 31st, 2009 @ 12:05 AM Reply


For a test input I enter the Principal as $4500, the Rate as 9.5%, and the Time at 6 yrs. The outcome is $256500. Is there a way for me to change the output from $256500 to $2565.00?

printf ("$%.02f", value / 100.) ;

Porkchop
Porkchop
  • Member since: Mar. 10, 2008
  • Offline.
Forum Stats
Member
Level 23
Art Lover
Response to C++: Main Oct. 31st, 2009 @ 09:33 PM Reply

At 10/31/09 12:05 AM, thingie-348 wrote:

For a test input I enter the Principal as $4500, the Rate as 9.5%, and the Time at 6 yrs. The outcome is $256500. Is there a way for me to change the output from $256500 to $2565.00?
printf ("$%.02f", value / 100.) ;

Thanks a lot!


[WWE Fans][XBL: PissedMexicans][Toonami Aftermath]

BBS Signature
Wolfos
Wolfos
  • Member since: Jan. 19, 2008
  • Offline.
Forum Stats
Member
Level 25
Game Developer
Response to C++: Main Oct. 12th, 2010 @ 02:19 PM Reply

Can I still contribute? I can write an SDL tutorial for displaying images on the screen.

Jon-86
Jon-86
  • Member since: Jan. 30, 2007
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to C++: Main Oct. 12th, 2010 @ 03:01 PM Reply

Why now...Go for it I say!


PHP Main :: C++ Main :: Java Main :: Vorsprung durch Technik
irc.freenode.net #ngprogramming

BBS Signature
AndyPerfect
AndyPerfect
  • Member since: Jan. 13, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to C++: Main Oct. 12th, 2010 @ 06:45 PM Reply

Since I didn't know this little topic existed, I'll throw down a little tutorial I wrote a while back for creating a DLL in C++ and then reading that DLL in any other .NET language. The webpage is fairly boring at the moment, but the article is golden =)

Enjoy <3

http://afome.com/cplusplusdll.php

Trunks
Trunks
  • Member since: Jul. 31, 2005
  • Offline.
Forum Stats
Member
Level 22
Musician
Response to C++: Main Oct. 13th, 2010 @ 12:40 AM Reply

Is C++ incredibly popular? I know most of the syntax, I took a course for it last year and because I'm a CompSci major in college my first Computing class is learning C. I'm searching (halfheartedly, I guess) around to find which is the most common programming language that game engines are coded in so I can get a head start and start perfecting my knowledge of the language.

Obviously not talking about flash games, here, lol.


Check out my band by clicking my sig!

BBS Signature
Wolfos
Wolfos
  • Member since: Jan. 19, 2008
  • Offline.
Forum Stats
Member
Level 25
Game Developer
Response to C++: Main Oct. 14th, 2010 @ 01:52 PM Reply

At 10/13/10 12:40 AM, Trunks wrote: Is C++ incredibly popular? I know most of the syntax, I took a course for it last year and because I'm a CompSci major in college my first Computing class is learning C. I'm searching (halfheartedly, I guess) around to find which is the most common programming language that game engines are coded in so I can get a head start and start perfecting my knowledge of the language.

Obviously not talking about flash games, here, lol.

Yeah, C++ is kind of the standard for games but it is VERY similar to C.
I don't mean Visual basic 6 and VB7 similar (that it only works in theory), but in theory every C code is compatible with C++ and that goes as far as entire frameworks that were written in C work in C++ without any kind of adjustment (like OpenGL).

Wolfos
Wolfos
  • Member since: Jan. 19, 2008
  • Offline.
Forum Stats
Member
Level 25
Game Developer
Response to C++: Main Oct. 14th, 2010 @ 02:22 PM Reply

Just wrote displaying an image with SDL.

It belongs to Beginner: specific.

Trunks
Trunks
  • Member since: Jul. 31, 2005
  • Offline.
Forum Stats
Member
Level 22
Musician
Response to C++: Main Oct. 14th, 2010 @ 03:08 PM Reply

At 10/14/10 01:52 PM, Wolfos wrote: Yeah, C++ is kind of the standard for games but it is VERY similar to C.
I don't mean Visual basic 6 and VB7 similar (that it only works in theory), but in theory every C code is compatible with C++ and that goes as far as entire frameworks that were written in C work in C++ without any kind of adjustment (like OpenGL).

Yeah, that's why c is very easy for me, because I know the syntax of c++. It's annoying going backwards in time, though, because c++ to me seems like optimized c (which, i guess, it kind of is). So I guess c++ is going to be my new forte :D


Check out my band by clicking my sig!

BBS Signature
UnknownFear
UnknownFear
  • Member since: Feb. 27, 2004
  • Offline.
Forum Stats
Member
Level 37
Gamer
Response to C++: Main Nov. 11th, 2010 @ 09:44 AM Reply

I've added a C tutorial! :)

C: Hello, World!

Wolfos
Wolfos
  • Member since: Jan. 19, 2008
  • Offline.
Forum Stats
Member
Level 25
Game Developer
Response to C++: Main Nov. 17th, 2010 @ 04:05 PM Reply

At 11/11/10 09:44 AM, UnknownFear wrote: I've added a C tutorial! :)

C: Hello, World!

It's called C++: Main for a reason...
In C++, main() should be an int.

UnknownFear
UnknownFear
  • Member since: Feb. 27, 2004
  • Offline.
Forum Stats
Member
Level 37
Gamer
Response to C++: Main Nov. 18th, 2010 @ 01:19 PM Reply

At 11/17/10 04:05 PM, Wolfos wrote: It's called C++: Main for a reason...
In C++, main() should be an int.

Well excuse me for writing my C tutorial... in C instead of C++. The main page of this thread clearly states you can write C tutorials as well.

Wolfos
Wolfos
  • Member since: Jan. 19, 2008
  • Offline.
Forum Stats
Member
Level 25
Game Developer
Response to C++: Main Nov. 26th, 2010 @ 07:13 AM Reply

At 11/18/10 01:19 PM, UnknownFear wrote:
At 11/17/10 04:05 PM, Wolfos wrote: It's called C++: Main for a reason...
In C++, main() should be an int.
Well excuse me for writing my C tutorial... in C instead of C++. The main page of this thread clearly states you can write C tutorials as well.

My apologies then, for not fully reading the main page.

UnknownFear
UnknownFear
  • Member since: Feb. 27, 2004
  • Offline.
Forum Stats
Member
Level 37
Gamer
Response to C++: Main Nov. 26th, 2010 @ 06:42 PM Reply

At 11/26/10 07:13 AM, Wolfos wrote: My apologies then, for not fully reading the main page.

It's all good. That may be the only C tutorial I will write if anyone else cares to.

Wolfos
Wolfos
  • Member since: Jan. 19, 2008
  • Offline.
Forum Stats
Member
Level 25
Game Developer
Wolfos
Wolfos
  • Member since: Jan. 19, 2008
  • Offline.
Forum Stats
Member
Level 25
Game Developer
Response to C++: Main Dec. 12th, 2011 @ 11:30 AM Reply

Enums and Structs