• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 23:06
CET 05:06
KST 13:06
  • 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: The Forgotten Master of ZvT25Behind the Blue - Team Liquid History Book17Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info8
Community News
Weekly Cups (Feb 9-15): herO doubles up2ACS replaced by "ASL Season Open" - Starts 21/0241LiuLi Cup: 2025 Grand Finals (Feb 10-16)46Weekly Cups (Feb 2-8): Classic, Solar, MaxPax win2Nexon's StarCraft game could be FPS, led by UMS maker16
StarCraft 2
General
Behind the Blue - Team Liquid History Book ByuL: The Forgotten Master of ZvT Liquipedia WCS Portal Launched Kaelaris on the futue of SC2 and much more... How do you think the 5.0.15 balance patch (Oct 2025) for StarCraft II has affected the game?
Tourneys
PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar) Sparkling Tuna Cup - Weekly Open Tournament StarCraft Evolution League (SC Evo Biweekly) How do the "codes" work in GSL? LiuLi Cup: 2025 Grand Finals (Feb 10-16)
Strategy
Custom Maps
Map Editor closed ? [A] Starcraft Sound Mod
External Content
Mutation # 514 Ulnar New Year The PondCast: SC2 News & Results Mutation # 513 Attrition Warfare Mutation # 512 Overclocked
Brood War
General
Do you consider PvZ imbalanced? A new season just kicks off A cwal.gg Extension - Easily keep track of anyone Recent recommended BW games BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[Megathread] Daily Proleagues Escore Tournament StarCraft Season 1 Small VOD Thread 2.0 KCM Race Survival 2026 Season 1
Strategy
Simple Questions, Simple Answers Zealot bombing is no longer popular? Fighting Spirit mining rates Current Meta
Other Games
General Games
Diablo 2 thread Battle Aces/David Kim RTS Megathread Nintendo Switch Thread ZeroSpace Megathread Path of Exile
Dota 2
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 Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia TL Mafia Community Thread Mafia Game Mode Feedback/Ideas
Community
General
Mexico's Drug War US Politics Mega-thread Russo-Ukrainian War Thread Canadian Politics Mega-thread Ask and answer stupid questions here!
Fan Clubs
The IdrA Fan Club The herO Fan Club!
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books [Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion TL MMA Pick'em Pool 2013
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
ASL S21 English Commentary…
namkraft
Inside the Communication of …
TrAiDoS
My 2025 Magic: The Gathering…
DARKING
Life Update and thoughts.
FuDDx
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2107 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
Hyrule19193 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
Hyrule19193 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
Hyrule19193 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
Hyrule19193 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
Hyrule19193 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
Hyrule19193 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
Hyrule19193 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
Replay Cast
00:00
HomeStory Cup 28 - Playoffs
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 259
Nina 194
FoxeR 89
Ketroc 59
StarCraft: Brood War
GuemChi 2225
Snow 230
Leta 192
Icarus 10
Dota 2
monkeys_forever577
NeuroSwarm153
LuMiX1
League of Legends
JimRising 829
Counter-Strike
taco 609
Super Smash Bros
hungrybox499
Heroes of the Storm
Khaldor159
Other Games
summit1g13131
WinterStarcraft548
C9.Mang0446
Organizations
Other Games
gamesdonequick1000
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 20 non-featured ]
StarCraft 2
• Berry_CruncH177
• Hupsaiya 80
• davetesta17
• Response 8
• Kozan
• Migwel
• sooper7s
• AfreecaTV YouTube
• intothetv
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• Azhi_Dahaki19
• RayReign 10
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
League of Legends
• Scarra2491
• Rush1270
• Lourlo969
• Doublelift692
Upcoming Events
Replay Cast
4h 54m
Wardi Open
7h 54m
Monday Night Weeklies
12h 54m
OSC
19h 54m
WardiTV Winter Champion…
1d 7h
Replay Cast
2 days
WardiTV Winter Champion…
2 days
The PondCast
3 days
Replay Cast
3 days
Korean StarCraft League
4 days
[ Show More ]
CranKy Ducklings
5 days
SC Evo Complete
5 days
Replay Cast
5 days
Sparkling Tuna Cup
6 days
uThermal 2v2 Circuit
6 days
Liquipedia Results

Completed

Proleague 2026-02-22
LiuLi Cup: 2025 Grand Finals
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
Acropolis #4 - TS5
WardiTV Winter 2026
PiG Sty Festival 7.0
Nations Cup 2026
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025

Upcoming

Jeongseon Sooper Cup
Spring Cup 2026
[S:21] ASL SEASON OPEN 2nd Round
[S:21] ASL SEASON OPEN 2nd Round Qualifier
Acropolis #4 - TS6
Acropolis #4
IPSL Spring 2026
HSC XXIX
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
RSL Revival: Season 4
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
FISSURE Playground #3
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
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.