• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 02:43
CEST 08:43
KST 15:43
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
ByuL, and the Limitations of Standard Play0Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12TL.net Map Contest #22 - Voting & Ladder Map Selection7Code S Season 2 (2026) - RO8 Preview8
Community News
[TLMC] Summer 2026 Ladder Map Rotation05.0.16 patch for SC2 goes live (8 worker start)61ZeroSpace at Steam NextFest - Last free demo30Weekly Cups (June 8-14): Clem and Solar double, PTR tested0RSL: S6 Finals played at BlizzCon 202611
StarCraft 2
General
Enough with this crap patch: boring and suck! Possible bug in the new patch? Map Pool Suggestion For 1v1 HackErIsTop take on Patch 5.0.16 5.0.16 patch for SC2 goes live (8 worker start)
Tourneys
Douyu Cup 2026: $20,000 Legends Event (June 26-28) INu's Battles#17 <BO.9> RSL Revival: Season 6 - Qualifiers and Main Event Sparkling Tuna Cup - Weekly Open Tournament GSL CK #4 20-21th June
Strategy
[G] Having the right mentality to improve
Custom Maps
New Map Maker - Looking for Advice - Love or Hate Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
The PondCast: SC2 News & Results Mutation # 531 Experimental Artillery Mutation # 530 One For All Mutation # 529 Opportunities Unleashed
Brood War
General
ASL 22 Proposed Map Pool [BSL22] Non-Korean Championship from 13 to 28 June BSL Season 22 BW General Discussion STARCRAFT MOVIE - Last Night at the Command center
Tourneys
[Megathread] Daily Proleagues [BSL22] GosuLeague Casts - Tue & Thu 22:00 CEST CSLAN 4 is Coming! Small VOD Thread 2.0
Strategy
Why doesn't anyone use restoration? Simple Questions, Simple Answers Relatively freeroll strategies Creating a full chart of Zerg builds
Other Games
General Games
ZeroSpace at Steam NextFest - Last free demo Stormgate/Frost Giant Megathread Games for Kids Nintendo Switch Thread The Perfect Game
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
Vanilla Mini Mafia
Community
General
US Politics Mega-thread Canadian Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread [H]Internet/Gaming Cafe Tips and Tricks
Fan Clubs
The HerO Fan Club! The herO Fan Club!
Media & Entertainment
Movie Discussion! Series you have seen recently... [Req][Books] Good Fantasy/SciFi books [TV/BOOK] *SPOILERS* Game of Thrones Discussion
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 McBoner: A hockey love story Formula 1 Discussion Cricket [SPORT]
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Facing Challenges in Mobile App Development
TL Community
The Automated Ban List
Blogs
How To Predict Tilt in Espor…
TrAiDoS
An Exploration of th…
waywardstrategy
I'm an arrogant trash talke…
FlaShFTW
Gauntlet SC2: A Retrospectiv…
Ctone23
Why RTS gamers make better f…
gosubay
Customize Sidebar...

Website Feedback

Closed Threads



Active: 12278 users

The Big Programming Thread - Page 88

Forum Index > General Forum
Post a Reply
Prev 1 86 87 88 89 90 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
tofucake
Profile Blog Joined October 2009
Hyrule19223 Posts
October 20 2011 19:39 GMT
#1741
Variable initialization...arg

You need to reset your variables after each line.
Liquipediaasante sana squash banana
Frosticles
Profile Joined May 2010
United States50 Posts
October 20 2011 19:41 GMT
#1742
I figured that's what it was, but how exactly do I code that into the while loop?
tofucake
Profile Blog Joined October 2009
Hyrule19223 Posts
October 20 2011 19:44 GMT
#1743

int a = 0, b = 0, c = 0, etc...

while(condition)
{
** do stuff **
** do stuff **
** do stuff **

a = 0;
b = 0;
c = 0;
etc...
}
Liquipediaasante sana squash banana
sekritzzz
Profile Joined December 2010
1515 Posts
October 20 2011 19:45 GMT
#1744
I'm entering a new world here and have always been intrigued by programming in general. I already have a finance/economics major so I do have a decent math background. I'm completely new to programming and have no idea what a lot of the terms mean, should I start by having a browse through HTML/CSS/Javascript sites provided in the OP? or are the subject-matters not ranked in any particular order? Hopefully I can contribute to this thread in the near future when im more knowledgeable.


Any advice to newcomers(ex:me) is greatly appreciated, could always learn from more experienced people.
tofucake
Profile Blog Joined October 2009
Hyrule19223 Posts
October 20 2011 19:48 GMT
#1745
Stuff is broken down into languages (or groups, ie HTML/CSS/Javascript). The particular section you read really depends on your interests. If you want to do website type things, HTML/CSS/Javascript are basically required (not so much Javascript). Actual programming in terms of web stuff will likely be PHP, ASP (.Net in general), or Perl.

On the other hand, if you want to do programming you're going to want to focus more on a "traditional" language, typically of the C family (or Java if you hate yourself).
Liquipediaasante sana squash banana
Frosticles
Profile Joined May 2010
United States50 Posts
October 20 2011 19:49 GMT
#1746
I tried coding it like this


inFile >> partnum >> intialamnt >> qntysold >> minamnt;
while (inFile.good())
{
currentbalance = (intialamnt - qntysold);
cout << partnum << " " << currentbalance << " " << qntysold << " " << minamnt << endl;
inFile >> partnum >> currentbalance >> qntysold >> minamnt;
currentbalance = 0;
initialamnt = 0;
qntysold = 0;
}


and it is now giving me error messages...
8.2_9.cpp: In function `int main()':
8.2_9.cpp:36: error: `initialamnt' undeclared (first use this function)
8.2_9.cpp:36: error: (Each undeclared identifier is reported only once for each
function it appears in.)
8.2_9.cpp:43:2: warning: no newline at end of file


I understand the concept of what your saying, but I don't understand how to implement it in my code.
tofucake
Profile Blog Joined October 2009
Hyrule19223 Posts
Last Edited: 2011-10-20 19:53:13
October 20 2011 19:51 GMT
#1747
Which line is 36?

Also I see you're reading and then trying to reset some stuff. Odd way of doing things.
Liquipediaasante sana squash banana
Frosticles
Profile Joined May 2010
United States50 Posts
October 20 2011 19:53 GMT
#1748
line 36 is just the end bracket for the while loop. The line directly after qntysold = 0;
tofucake
Profile Blog Joined October 2009
Hyrule19223 Posts
October 20 2011 20:00 GMT
#1749
Potentially the result of stray curly braces then. Post full source again?
Liquipediaasante sana squash banana
Frosticles
Profile Joined May 2010
United States50 Posts
October 20 2011 20:03 GMT
#1750
full source code



+ Show Spoiler +

#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
using namespace std;

int main()
{
string filename = "inventory.txt";
ifstream inFile;
string partnum;
double intialamnt = 0;
double qntysold = 0;
double minamnt = 0;
double currentbalance = 0;
double minlevel;




inFile.open(filename.c_str()); //opens the file

if (inFile.fail())
{
cout << "The file was not successfuly opened" << endl;
exit(1);
}

inFile >> partnum >> intialamnt >> qntysold >> minamnt;
while (inFile.good())
{
currentbalance = (intialamnt - qntysold);
cout << partnum << " " << currentbalance << " " << qntysold << " " << minamnt << endl;
inFile >> partnum >> currentbalance >> qntysold >> minamnt;
currentbalance = 0;
initialamnt = 0;
qntysold = 0;
}

inFile.close();

return 0;

}


Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
October 20 2011 20:03 GMT
#1751
On October 21 2011 04:49 Frosticles wrote:
I tried coding it like this


inFile >> partnum >> intialamnt >> qntysold >> minamnt;
while (inFile.good())
{
currentbalance = (intialamnt - qntysold);
cout << partnum << " " << currentbalance << " " << qntysold << " " << minamnt << endl;
inFile >> partnum >> currentbalance >> qntysold >> minamnt;
currentbalance = 0;
initialamnt = 0;
qntysold = 0;
}


and it is now giving me error messages...
8.2_9.cpp: In function `int main()':
8.2_9.cpp:36: error: `initialamnt' undeclared (first use this function)
8.2_9.cpp:36: error: (Each undeclared identifier is reported only once for each
function it appears in.)
8.2_9.cpp:43:2: warning: no newline at end of file


I understand the concept of what your saying, but I don't understand how to implement it in my code.


check the spelling of your variables.
sekritzzz
Profile Joined December 2010
1515 Posts
October 20 2011 20:06 GMT
#1752
On October 21 2011 04:48 tofucake wrote:
Stuff is broken down into languages (or groups, ie HTML/CSS/Javascript). The particular section you read really depends on your interests. If you want to do website type things, HTML/CSS/Javascript are basically required (not so much Javascript). Actual programming in terms of web stuff will likely be PHP, ASP (.Net in general), or Perl.

On the other hand, if you want to do programming you're going to want to focus more on a "traditional" language, typically of the C family (or Java if you hate yourself).

Are all groups separate or is one group a prerequisite to doing the job of another group?

I'm more or less interested in making programs which probably fall into the "C family". Should I learn other languages before going into it or can I nosedive in? Also is it feasible for me to do a daily job and attempt to learn all 3 or should I concentrate my efforts towards one thing? I get the feeling that when it comes to programming, its more efficient to stick to one thing due to its never ending possibilities of progress.
Frosticles
Profile Joined May 2010
United States50 Posts
October 20 2011 20:08 GMT
#1753
Ok I fixed the spelling errors, but now my output looks like this....

QA310 48 47 50
CM145 0 0 200
MS514 0 0 25
EN212 0 0 160


heres the source code again
+ Show Spoiler +

#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
using namespace std;

int main()
{
string filename = "inventory.txt";
ifstream inFile;
string partnum;
double initialamnt = 0;
double qntysold = 0;
double minamnt = 0;
double currentbalance = 0;
double minlevel;




inFile.open(filename.c_str()); //opens the file

if (inFile.fail())
{
cout << "The file was not successfuly opened" << endl;
exit(1);
}

inFile >> partnum >> initialamnt >> qntysold >> minamnt;
while (inFile.good())
{
currentbalance = (initialamnt - qntysold);
cout << partnum << " " << currentbalance << " " << qntysold << " " << minamnt << endl;
inFile >> partnum >> currentbalance >> qntysold >> minamnt;
currentbalance = 0;
initialamnt = 0;
qntysold = 0;
}

inFile.close();

return 0;

}




tofucake
Profile Blog Joined October 2009
Hyrule19223 Posts
October 20 2011 20:16 GMT
#1754
On October 21 2011 05:06 sekritzzz wrote:
Show nested quote +
On October 21 2011 04:48 tofucake wrote:
Stuff is broken down into languages (or groups, ie HTML/CSS/Javascript). The particular section you read really depends on your interests. If you want to do website type things, HTML/CSS/Javascript are basically required (not so much Javascript). Actual programming in terms of web stuff will likely be PHP, ASP (.Net in general), or Perl.

On the other hand, if you want to do programming you're going to want to focus more on a "traditional" language, typically of the C family (or Java if you hate yourself).

Are all groups separate or is one group a prerequisite to doing the job of another group?

I'm more or less interested in making programs which probably fall into the "C family". Should I learn other languages before going into it or can I nosedive in? Also is it feasible for me to do a daily job and attempt to learn all 3 or should I concentrate my efforts towards one thing? I get the feeling that when it comes to programming, its more efficient to stick to one thing due to its never ending possibilities of progress.

Nosedive! HTML is probably irrelevant if you want to do C stuff. For C, you basically need to use a tutorial if you're completely unfamiliar with programming.

What I've found with programming is that once you learn programming, most languages end up being more like tools, and after a while end up being pretty easy to pick up. The important part is learning programming though, so decide on a first language to use and try not to stray for a while.
Liquipediaasante sana squash banana
tofucake
Profile Blog Joined October 2009
Hyrule19223 Posts
October 20 2011 20:17 GMT
#1755
On October 21 2011 05:08 Frosticles wrote:
Ok I fixed the spelling errors, but now my output looks like this....

QA310 48 47 50
CM145 0 0 200
MS514 0 0 25
EN212 0 0 160


heres the source code again
+ Show Spoiler +

#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
using namespace std;

int main()
{
string filename = "inventory.txt";
ifstream inFile;
string partnum;
double initialamnt = 0;
double qntysold = 0;
double minamnt = 0;
double currentbalance = 0;
double minlevel;




inFile.open(filename.c_str()); //opens the file

if (inFile.fail())
{
cout << "The file was not successfuly opened" << endl;
exit(1);
}

inFile >> partnum >> initialamnt >> qntysold >> minamnt;
while (inFile.good())
{
currentbalance = (initialamnt - qntysold);
cout << partnum << " " << currentbalance << " " << qntysold << " " << minamnt << endl;
inFile >> partnum >> currentbalance >> qntysold >> minamnt;
currentbalance = 0;
initialamnt = 0;
qntysold = 0;
}

inFile.close();

return 0;

}


First: code tags
Second, I gave you a hint already!

On October 21 2011 04:51 tofucake wrote:
Also I see you're reading and then trying to reset some stuff. Odd way of doing things.

Liquipediaasante sana squash banana
Kfish
Profile Blog Joined May 2010
Chile282 Posts
October 20 2011 20:19 GMT
#1756
I've been learning to program in some languages such as C#, Java, C++, C and recently started reading some Python.

I guess I reached an intermediate level, I understand inheritance, polymorphism, pointers to a certain extent (still can't figure out what the HEAP and STACK are lol), and I'm learning some SQL. I can see the differences in the languages and I'm starting to find out why one might be better than another for certain tasks. I'm really a newb though, haven't finished my first year at uni but I do read a lot and try to code a lot.

I still can't manage to DO SOMETHING useful with this. I have no idea where to start making a name for myself besides the books.

I've read, start contributing to open source. That sounds great! Where do I start? NO CLUE! haha

I even started making a game engine with opengl tao framework in C# (until I realized the book I was reading has some fail to it).

What do I need to do? I'm frustrated, I want to make something useful already. How do I get an idea and put it on paper and then into code, thats something I haven't learned in books or my Uni courses yet.

I feel that there is so much to learn out there that I don't know what to focus on first. I mean, I realize I should be polishing my skills in one language instead of reading through and learning the basics/intermediate stuff for a whole bunch.

Help is appreciated, I love programming and I want to learn it all... I could use some guidance.
mmp
Profile Blog Joined April 2009
United States2130 Posts
October 20 2011 20:21 GMT
#1757
On October 21 2011 04:48 tofucake wrote:
Stuff is broken down into languages (or groups, ie HTML/CSS/Javascript). The particular section you read really depends on your interests. If you want to do website type things, HTML/CSS/Javascript are basically required (not so much Javascript). Actual programming in terms of web stuff will likely be PHP, ASP (.Net in general), or Perl.

On the other hand, if you want to do programming you're going to want to focus more on a "traditional" language, typically of the C family (or Java if you hate yourself).

What? If you do your programming in Javascript, you can very easily share your code via HTTP. And it is very rare today to see websites that use little-to-no Javascript, even if it is often abused for shiny bullshit.

Also, ASP is antiquated and .NET is baroque. If you want to do *modern* backend dev you should look into Django, Rails, JSP/Tomcat, or one of the many frameworks built on top of PHP. You have a lot of good alternatives when making a web server today, but PHP is probably the only legacy server-side language that is still relevant.
I (λ (foo) (and (<3 foo) ( T_T foo) (RAGE foo) )) Starcraft
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
October 20 2011 20:22 GMT
#1758
On October 21 2011 05:06 sekritzzz wrote:
Show nested quote +
On October 21 2011 04:48 tofucake wrote:
Stuff is broken down into languages (or groups, ie HTML/CSS/Javascript). The particular section you read really depends on your interests. If you want to do website type things, HTML/CSS/Javascript are basically required (not so much Javascript). Actual programming in terms of web stuff will likely be PHP, ASP (.Net in general), or Perl.

On the other hand, if you want to do programming you're going to want to focus more on a "traditional" language, typically of the C family (or Java if you hate yourself).

Are all groups separate or is one group a prerequisite to doing the job of another group?

I'm more or less interested in making programs which probably fall into the "C family". Should I learn other languages before going into it or can I nosedive in? Also is it feasible for me to do a daily job and attempt to learn all 3 or should I concentrate my efforts towards one thing? I get the feeling that when it comes to programming, its more efficient to stick to one thing due to its never ending possibilities of progress.


There are lots of programmers who focus on one language and area, but every good programmer at least dabbles in other areas and learns other languages. Until recently, i made it my goal to learn one new language every year and it helped me a ton.

By checking out other languages you often see your main language from a new perspective and find new ways to solve problems. I can't tell you how much i learned from only one day of dabbling with scheme about how wrong i was approaching problems previously, eventhough i was already fluid in about 10 programming languages before that.

To start, i would recommend going with "easy" languages that get stuff done fast, i.e. PHP for web development, C# for GUIs and Javascript if you want to focus more on web design.
sekritzzz
Profile Joined December 2010
1515 Posts
October 20 2011 20:33 GMT
#1759
Thanks a lot everyone for your help, it really did a lot for me. I'll have a go at C# as soon as I can since I seem to lean towards it. Much appreciated.
redbrain
Profile Joined January 2011
Northern Ireland117 Posts
October 20 2011 20:36 GMT
#1760
i'm actually a GCC developer maybes i can help some people if they need
Frustrated Software Developer
Prev 1 86 87 88 89 90 1032 Next
Please log in or register to reply.
Live Events Refresh
Douyu Cup 2020
05:00
2026 - Day 1
Oliveira vs Trap
Jieshi vs XY
soO vs FanTaSy
TY vs Coffee
WardiTV400
CranKy Ducklings146
IndyStarCraft 94
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Ryung 624
PiGStarcraft547
NeuroSwarm 208
Nina 109
IndyStarCraft 94
ProTech90
SortOf 70
StateSC2 51
StarCraft: Brood War
Rain 2380
GuemChi 2270
Leta 439
Mind 243
Aegong 60
Movie 38
ZergMaN 32
Bale 28
Hm[arnc] 25
yabsab 20
[ Show more ]
NaDa 18
Icarus 8
NotJumperer 0
Dota 2
Fuzer 50
League of Legends
JimRising 645
Counter-Strike
m0e_tv663
Other Games
summit1g6990
Mew2King238
RuFF_SC242
Organizations
Other Games
gamesdonequick732
BasetradeTV285
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 15 non-featured ]
StarCraft 2
• 3DClanTV 62
• CranKy Ducklings SOOP21
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Rush1444
• Lourlo1408
• Stunt602
Upcoming Events
OSC
9h 17m
Douyu Cup 2020
22h 17m
Neeb vs Impact
MacSed vs Cyan
Scarlett vs Kelazhur
INnoVation vs Dear
Douyu Cup 2020
1d 22h
Maestros of the Game
2 days
herO vs Classic
Maru vs Serral
BSL22 NKC (BSL vs China)
2 days
Douyu Cup 2020
2 days
BSL22 NKC (BSL vs China)
3 days
Online Event
3 days
RSL Revival
3 days
WardiTV Weekly
4 days
[ Show More ]
RSL Revival
5 days
RSL Revival
5 days
Kung Fu Cup
6 days
OSC
6 days
Liquipedia Results

Completed

Proleague 2026-06-24
WardiTV Spring 2026
Heroes Pulsing #2

Ongoing

IPSL Spring 2026
Acropolis #4
CSCL: Masked Kings S4
YSL S3
BSL 22 Non-Korean Championship
CSL Season 21: Qualifier 1
CSL Season 21: Qualifier 2
SCTL 2026 Spring
Douyu Cup 2026
Maestros of the Game 2
Murky Cup 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
IEM Rio 2026

Upcoming

CSL 2026 Summer (S21)
CSLAN 4
Blizzard Classic Cup 2026
Kung Fu Cup 2026 Grand Finals
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
HSC XXIX
BCC 2026
Light Tournament 2026
Eternal Conflict S2 Finale
Eternal Conflict S2 E1
Heroes Pulsing #3
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.