• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 10:29
CET 16:29
KST 00:29
  • 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
TL.net Map Contest #21: Winners11Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13TL.net Map Contest #21: Voting12[ASL20] Ro4 Preview: Descent11
Community News
[TLMC] Fall/Winter 2025 Ladder Map Rotation6Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA8StarCraft, SC2, HotS, WC3, Returning to Blizzcon!45$5,000+ WardiTV 2025 Championship7
StarCraft 2
General
[TLMC] Fall/Winter 2025 Ladder Map Rotation Mech is the composition that needs teleportation t Weekly Cups (Nov 3-9): Clem Conquers in Canada Craziest Micro Moments Of All Time? SC: Evo Complete - Ranked Ladder OPEN ALPHA
Tourneys
Constellation Cup - Main Event - Stellar Fest Tenacious Turtle Tussle Sparkling Tuna Cup - Weekly Open Tournament $5,000+ WardiTV 2025 Championship Merivale 8 Open - LAN - Stellar Fest
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection
Brood War
General
BW General Discussion FlaSh on: Biggest Problem With SnOw's Playstyle Terran 1:35 12 Gas Optimization BGH Auto Balance -> http://bghmmr.eu/ [ASL20] Ask the mapmakers — Drop your questions
Tourneys
[BSL21] RO32 Group D - Sunday 21:00 CET [BSL21] RO32 Group C - Saturday 21:00 CET [ASL20] Grand Finals [Megathread] Daily Proleagues
Strategy
Current Meta PvZ map balance How to stay on top of macro? Soma's 9 hatch build from ASL Game 2
Other Games
General Games
EVE Corporation Nintendo Switch Thread Stormgate/Frost Giant Megathread Should offensive tower rushing be viable in RTS games? 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
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread The Games Industry And ATVI
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece Anime Discussion Thread Movie Discussion! Korean Music Discussion Series you have seen recently...
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Dyadica Gospel – a Pulp No…
Hildegard
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Reality "theory" prov…
perfectspheres
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1235 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
Hyrule19151 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
Hyrule19151 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
Hyrule19151 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
Hyrule19151 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
Hyrule19151 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
Hyrule19151 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
Hyrule19151 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
OSC
11:30
Mid Season Playoffs
Krystianer vs PercivalLIVE!
WardiTV1063
TKL 199
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
TKL 199
SteadfastSC 109
Rex 91
StarCraft: Brood War
Calm 3367
Bisu 2918
Rain 2430
Hyuk 1473
Horang2 984
Flash 514
Soma 498
Stork 393
Rush 303
Soulkey 121
[ Show more ]
Backho 114
Barracks 58
sas.Sziky 46
hero 38
Aegong 27
zelot 22
sSak 21
Terrorterran 20
Rock 19
Killer 16
Dota 2
Gorgc3152
qojqva2018
Dendi1105
BananaSlamJamma123
XcaliburYe100
Other Games
hiko638
Sick526
DeMusliM442
Hui .346
Fuzer 199
Mew2King94
QueenE50
Organizations
StarCraft: Brood War
Kim Chul Min (afreeca) 9
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• poizon28 22
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• HerbMon 10
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 3021
• WagamamaTV453
League of Legends
• Nemesis4037
• TFBlade977
Upcoming Events
Tenacious Turtle Tussle
7h 31m
The PondCast
18h 31m
RSL Revival
18h 31m
Solar vs Zoun
MaxPax vs Bunny
Kung Fu Cup
20h 31m
WardiTV Korean Royale
20h 31m
PiGosaur Monday
1d 9h
RSL Revival
1d 18h
Classic vs Creator
Cure vs TriGGeR
Kung Fu Cup
1d 20h
CranKy Ducklings
2 days
RSL Revival
2 days
herO vs Gerald
ByuN vs SHIN
[ Show More ]
Kung Fu Cup
2 days
IPSL
3 days
ZZZero vs rasowy
Napoleon vs KameZerg
BSL 21
3 days
Tarson vs Julia
Doodle vs OldBoy
eOnzErG vs WolFix
StRyKeR vs Aeternum
Sparkling Tuna Cup
3 days
RSL Revival
3 days
Reynor vs sOs
Maru vs Ryung
Kung Fu Cup
3 days
WardiTV Korean Royale
3 days
BSL 21
4 days
JDConan vs Semih
Dragon vs Dienmax
Tech vs NewOcean
TerrOr vs Artosis
IPSL
4 days
Dewalt vs WolFix
eOnzErG vs Bonyth
Wardi Open
4 days
Monday Night Weeklies
5 days
WardiTV Korean Royale
5 days
The PondCast
6 days
Liquipedia Results

Completed

Proleague 2025-11-07
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual

Upcoming

SLON Tour Season 2
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
RSL Revival: Season 3
META Madness #9
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
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 © 2025 TLnet. All Rights Reserved.