Be a Supporter!
gumOnShoe
gumOnShoe
  • Member since: May. 29, 2004
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to C++: Main 2008-09-19 00:26:20 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 2008-12-27 20:24:46 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 2009-01-11 08:24:16 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 2009-01-11 08:55:15 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 2009-09-07 15:12:07 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 2009-09-07 23:25:44 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 2009-09-13 19:44:41 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 2009-10-29 21:06:37 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 2009-10-30 10:42:27 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 2009-10-31 00:05:35 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 2009-10-31 21:33:33 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 2010-10-12 14:19:32 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 2010-10-12 15:01:45 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 2010-10-12 18:45:24 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 2010-10-13 00:40:00 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.


Web developer, software engineer, musician, all-around nerd.

Wolfos
Wolfos
  • Member since: Jan. 19, 2008
  • Offline.
Forum Stats
Member
Level 25
Game Developer
Response to C++: Main 2010-10-14 13:52:02 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 2010-10-14 14:22:32 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 2010-10-14 15:08:20 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


Web developer, software engineer, musician, all-around nerd.

UnknownFear
UnknownFear
  • Member since: Feb. 27, 2004
  • Offline.
Forum Stats
Member
Level 37
Gamer
Response to C++: Main 2010-11-11 09:44:12 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 2010-11-17 16:05:00 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 2010-11-18 13:19:34 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 2010-11-26 07:13:30 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 2010-11-26 18:42:39 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
Response to C++: Main 2011-02-15 10:54:08 Reply

Writing cross platform portable code using precompiler constants

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

Enums and Structs