PHO - Pokémon Hackers Online
Go Back   PHO - Pokémon Hackers Online > Homebrew & Coding > Coding Discussion

Coding Discussion Discuss programming and coding and get help here.

Reply
 
Thread Tools Display Modes
Old 1st January 2014, 09:53 AM   #1
Kakarot1212
/member.php?u=433319
 
Kakarot1212's Avatar
 
Join Date: Dec 2013
Location: Philippines
Age: 20
Posts: 90
Kakarot1212
Default C and C++ Discussion Thread

So as of right now, i'm still learning C and C++, so i want to get some help from the experts of the community

So whats better? Or wich should i invest more of my time, C or C++? And why?

Sorry for many questions x)
Kakarot1212 is offline   Reply With Quote
Sponsored Links
Old 4th January 2014, 06:20 PM   #2
Black Charizard
Horus/Seth/Black Charizard.
Ex-StaffPHO VIP
 
Black Charizard's Avatar
 
Join Date: Apr 2010
Age: 25
Posts: 48
Black Charizard
Default

C++ better for creating game related programs imo. (it's an iteration of c with more functionality like jambo mentions as well)

Last edited by Black Charizard; 5th January 2014 at 06:03 PM.
Black Charizard is offline   Reply With Quote
Old 5th January 2014, 10:29 AM   #3
Jambo51
Glory To Arstotzka
Ex-Staff
 
Jambo51's Avatar
 
Join Date: May 2012
Location: Scotland
Posts: 92
Jambo51
Default

C++ is just that. It's an iteration of C with added functionality. There's little sense in learning as antiquated a language as C unless you plan to code Homebrew solutions for the GBA or Game Boy.

Besides which, in learning C++, you would learn most everything that C can do anyway!
__________________
I have nothing interesting to add

Last edited by Jambo51; 5th January 2014 at 10:29 AM. Reason: Spelling
Jambo51 is offline   Reply With Quote
Old 13th March 2014, 10:36 AM   #4
merkutinaa
n00b
 
Join Date: Mar 2014
Posts: 1
merkutinaa
Default

I've just started out learning C++. I was just wondering, is there ANY advantages of using C? If I master C++, is there really a point to learning C?
___________________
quick healthy meals ~ quick recipes for dinner ~ simple dinner recipes

Last edited by merkutinaa; 14th March 2014 at 07:14 AM.
merkutinaa is offline   Reply With Quote
Old 17th March 2014, 04:47 AM   #5
Kakarot1212
/member.php?u=433319
 
Kakarot1212's Avatar
 
Join Date: Dec 2013
Location: Philippines
Age: 20
Posts: 90
Kakarot1212
Default

I NEED THIS TO BE ANSWERED QUICK!

So i'm working on a project, simple library system. I just don't know how to do this one thing.

Example, the user will input the following datas: title, book number and author.
My question is, 1) how do I output it to a .txt file 2) how can I edit that txt file afterwards and 3) how can I delete the txt file. I know it is through fstream, but i don't know how to do it.
Give some sample code if possible. Help is appreciated!
Kakarot1212 is offline   Reply With Quote
Old 17th March 2014, 09:33 AM   #6
zZJoennZz
desudesudesudeathdesu
 
zZJoennZz's Avatar
 
Join Date: Apr 2010
Location: Philippines
Age: 21
Posts: 76
zZJoennZz
Default

Do you really need to use .txt file as data storage? Have you tried using database like MySQL or Microsoft SQL (There's still more)?
__________________

...mehehehe
zZJoennZz is offline   Reply With Quote
Old 17th March 2014, 10:59 AM   #7
Kakarot1212
/member.php?u=433319
 
Kakarot1212's Avatar
 
Join Date: Dec 2013
Location: Philippines
Age: 20
Posts: 90
Kakarot1212
Default

Quote:
Originally Posted by zZJoennZz View Post
Do you really need to use .txt file as data storage? Have you tried using database like MySQL or Microsoft SQL (There's still more)?
Thats diff. for other languages, I'm doing C++ so it's in .txt format.
Heres my code:
http://pastebin.com/6pm1a5NA
Kakarot1212 is offline   Reply With Quote
Likes Elsa liked this post
Old 5th April 2014, 08:41 AM   #8
zZJoennZz
desudesudesudeathdesu
 
zZJoennZz's Avatar
 
Join Date: Apr 2010
Location: Philippines
Age: 21
Posts: 76
zZJoennZz
Default

Oh pardon. I'm not that familiar with C++ connecting to database. So in C++ you couldn't connect it to a database? Sorry for the late reply.
__________________

...mehehehe
zZJoennZz is offline   Reply With Quote
Old 5th April 2014, 02:59 PM   #9
Full Metal ★
Unstable?
Ex-StaffPHO VIP
 
Full Metal ★'s Avatar
 
Join Date: Oct 2012
Posts: 326
Full Metal ★ Full Metal ★
Default

There's also the option of sqlite, which has many C++ wrappers. And there's the option of making your own binary storage format ( stdout.write ). Also, please for the love of god learn some better code formatting practices. Otherwise, try out this program. Just drag&drop the source file onto the program. Also, if you're interested, I made this library which allows you to write colored text / background in the console.
__________________

★ full metal.

#busy
Full Metal ★ is offline   Reply With Quote
Likes Elsa, Kakarot1212 liked this post
Old 21st April 2014, 02:16 AM   #10
Kakarot1212
/member.php?u=433319
 
Kakarot1212's Avatar
 
Join Date: Dec 2013
Location: Philippines
Age: 20
Posts: 90
Kakarot1212
Default

Quote:
Originally Posted by Full Metal ★ View Post
There's also the option of sqlite, which has many C++ wrappers. And there's the option of making your own binary storage format ( stdout.write ). Also, please for the love of god learn some better code formatting practices. Otherwise, try out this program. Just drag&drop the source file onto the program. Also, if you're interested, I made this library which allows you to write colored text / background in the console.
Hmm.. Its pretty much helpful for beginners like me. Thanks!
Kakarot1212 is offline   Reply With Quote
Reply

Tags
discussion, thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:42 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc. User Alert System provided by Advanced User Tagging (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Pokémon characters and images belong to Pokémon USA, Inc. and Nintendo.
Pokémon Hackers Online (PHO) is in no way affiliated with or endorsed by Nintendo LLC, Creatures, GAMEFREAK inc,
The Pokémon Company, Pokémon USA, Inc., The Pokémon Company International, or Wizards of the Coast.
All forum/site content (unless noted otherwise) and site designs are © 2006-2013 Pokémon Hackers Online (PHO).
Green Charizard Christos TreeckoLv100

"Black 2" by ARTPOP. Kyurem artwork by XOUS.

no new posts