• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 00:35
CEST 06:35
KST 13:35
  • 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
[ASL21] Ro16 Preview Pt2: All Star10Team Liquid Map Contest #22 - The Finalists16[ASL21] Ro16 Preview Pt1: Fresh Flow9[ASL21] Ro24 Preview Pt2: News Flash10[ASL21] Ro24 Preview Pt1: New Chaos0
Community News
2026 GSL Season 1 Qualifiers14Maestros of the Game 2 announced82026 GSL Tour plans announced14Weekly Cups (April 6-12): herO doubles, "Villains" prevail1MaNa leaves Team Liquid24
StarCraft 2
General
Maestros of the Game 2 announced Team Liquid Map Contest #22 - The Finalists MaNa leaves Team Liquid 2026 GSL Tour plans announced Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool
Tourneys
2026 GSL Season 1 Qualifiers Sparkling Tuna Cup - Weekly Open Tournament GSL CK: More events planned pending crowdfunding RSL Revival: Season 5 - Qualifiers and Main Event Master Swan Open (Global Bronze-Master 2)
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
Mutation # 522 Flip My Base The PondCast: SC2 News & Results Mutation # 521 Memorable Boss Mutation # 520 Moving Fees
Brood War
General
ASL21 General Discussion Pros React To: ASL S21, Ro.16 Group C BGH Auto Balance -> http://bghmmr.eu/ [TOOL] Starcraft Chat Translator Data needed
Tourneys
[ASL21] Ro16 Group C [ASL21] Ro16 Group D [Megathread] Daily Proleagues [ASL21] Ro16 Group B
Strategy
What's the deal with APM & what's its true value Simple Questions, Simple Answers Any training maps people recommend? Fighting Spirit mining rates
Other Games
General Games
Diablo IV Nintendo Switch Thread Dawn of War IV Starcraft Tabletop Miniature Game General RTS Discussion Thread
Dota 2
The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
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 Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread Russo-Ukrainian War Thread YouTube Thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [Req][Books] Good Fantasy/SciFi books Movie Discussion!
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Formula 1 Discussion Cricket [SPORT]
World Cup 2022
Tech Support
[G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Sexual Health Of Gamers
TrAiDoS
lurker extra damage testi…
StaticNine
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Iranian anarchists: organize…
XenOsky
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2094 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
Hyrule19203 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
Hyrule19203 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
Hyrule19203 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
Hyrule19203 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
Hyrule19203 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
Hyrule19203 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
Hyrule19203 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
2026 GSL Season 1: Qualifiers
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 196
Nina 104
StarCraft: Brood War
GuemChi 6139
ProTech141
yabsab 38
Backho 25
soO 16
Icarus 3
Dota 2
NeuroSwarm129
League of Legends
JimRising 731
Counter-Strike
summit1g8822
tarik_tv3692
Coldzera 1916
Fnx 627
Super Smash Bros
hungrybox1359
Other Games
C9.Mang0485
WinterStarcraft331
Maynarde98
Trikslyr28
Organizations
Other Games
gamesdonequick1096
BasetradeTV155
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 16 non-featured ]
StarCraft 2
• practicex 34
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• RayReign 36
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Rush992
• Lourlo875
• Stunt298
Other Games
• Scarra2158
Upcoming Events
The PondCast
5h 25m
KCM Race Survival
5h 25m
WardiTV Map Contest Tou…
6h 25m
Gerald vs herO
Clem vs Cure
ByuN vs Solar
Rogue vs MaxPax
ShoWTimE vs TBD
OSC
10h 25m
CranKy Ducklings
19h 25m
Escore
1d 5h
RSL Revival
1d 12h
Replay Cast
1d 19h
WardiTV Map Contest Tou…
2 days
Universe Titan Cup
2 days
Rogue vs Percival
[ Show More ]
Ladder Legends
2 days
uThermal 2v2 Circuit
2 days
BSL
2 days
Sparkling Tuna Cup
3 days
WardiTV Map Contest Tou…
3 days
Ladder Legends
3 days
BSL
3 days
Replay Cast
3 days
Replay Cast
4 days
Wardi Open
4 days
Afreeca Starleague
4 days
Soma vs hero
Monday Night Weeklies
4 days
Replay Cast
4 days
Afreeca Starleague
5 days
Leta vs YSC
Replay Cast
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2026-04-22
RSL Revival: Season 4
NationLESS Cup

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
StarCraft2 Community Team League 2026 Spring
WardiTV TLMC #16
Nations Cup 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026

Upcoming

Escore Tournament S2: W4
Acropolis #4
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
2026 GSL S2
RSL Revival: Season 5
2026 GSL S1
XSE Pro League 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
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.