• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 12:25
CEST 18:25
KST 01:25
  • 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
RSL Season 1 - Final Week6[ASL19] Finals Recap: Standing Tall12HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0
Community News
Esports World Cup 2025 - Brackets Revealed10Weekly Cups (July 7-13): Classic continues to roll4Team TLMC #5 - Submission extension3Firefly given lifetime ban by ESIC following match-fixing investigation17$25,000 Streamerzone StarCraft Pro Series announced7
StarCraft 2
General
RSL Revival patreon money discussion thread The GOAT ranking of GOAT rankings Who will win EWC 2025? Weekly Cups (July 7-13): Classic continues to roll Esports World Cup 2025 - Brackets Revealed
Tourneys
FEL Cracov 2025 (July 27) - $8000 live event RSL: Revival, a new crowdfunded tournament series $5,100+ SEL Season 2 Championship (SC: Evo) WardiTV Mondays Sparkling Tuna Cup - Weekly Open Tournament
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
External Content
Mutation # 482 Wheel of Misfortune Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome
Brood War
General
Flash Announces (and Retracts) Hiatus From ASL BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion Starcraft in widescreen A cwal.gg Extension - Easily keep track of anyone
Tourneys
[Megathread] Daily Proleagues Cosmonarchy Pro Showmatches CSL Xiamen International Invitational [BSL20] Non-Korean Championship 4x BSL + 4x China
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread CCLP - Command & Conquer League Project The PlayStation 5
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Future of Porn Stop Killing Games - European Citizens Initiative Summer Games Done Quick 2025!
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread [\m/] Heavy Metal Thread
Sports
Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023 2024 - 2025 Football Thread NBA General Discussion NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Men Take Risks, Women Win Ga…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 691 users

The Big Programming Thread - Page 88

Forum Index > General Forum
Post a Reply
Prev 1 86 87 88 89 90 1031 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
Hyrule19035 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
Hyrule19035 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
Hyrule19035 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
Hyrule19035 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
Hyrule19035 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
Hyrule19035 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
Hyrule19035 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 1031 Next
Please log in or register to reply.
Live Events Refresh
WardiTV European League
16:00
Swiss Groups Day 4
ShoWTimE vs sebesdes
Percival vs NightPhoenix
Shameless vs Nicoract
Krystianer vs Scarlett
ByuN vs uThermal
Harstem vs HeRoMaRinE
WardiTV419
TKL 154
IndyStarCraft 128
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 426
SpeCial 310
TKL 154
IndyStarCraft 128
BRAT_OK 48
ForJumy 43
UpATreeSC 34
StarCraft: Brood War
Britney 32803
Rain 4157
EffOrt 1332
BeSt 1191
firebathero 645
Stork 403
Larva 216
Rush 205
Light 187
Mind 130
[ Show more ]
Trikslyr71
Aegong 71
PianO 66
sSak 46
Movie 41
GoRush 31
Shinee 30
JulyZerg 24
scan(afreeca) 19
yabsab 17
Terrorterran 9
Shine 5
SilentControl 5
Bale 4
ivOry 4
Dota 2
qojqva4012
monkeys_forever193
League of Legends
Dendi1705
Counter-Strike
sgares680
flusha210
Other Games
FrodaN3290
B2W.Neo2498
singsing2207
Beastyqt487
ceh9429
Lowko282
Fuzer 243
Pyrionflax130
ToD98
Skadoodle73
Mew2King69
QueenE62
ArmadaUGS55
elazer31
oskar21
Organizations
Other Games
gamesdonequick3521
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 2498
League of Legends
• Nemesis3328
• Jankos1714
Upcoming Events
PiGosaur Monday
7h 35m
uThermal 2v2 Circuit
23h 35m
Replay Cast
1d 7h
The PondCast
1d 17h
WardiTV European League
1d 23h
Replay Cast
2 days
Epic.LAN
2 days
CranKy Ducklings
3 days
Epic.LAN
3 days
CSO Contender
4 days
[ Show More ]
BSL20 Non-Korean Champi…
4 days
Bonyth vs Sziky
Dewalt vs Hawk
Hawk vs QiaoGege
Sziky vs Dewalt
Mihu vs Bonyth
Zhanhun vs QiaoGege
QiaoGege vs Fengzi
Sparkling Tuna Cup
4 days
Online Event
4 days
BSL20 Non-Korean Champi…
5 days
Bonyth vs Zhanhun
Dewalt vs Mihu
Hawk vs Sziky
Sziky vs QiaoGege
Mihu vs Hawk
Zhanhun vs Dewalt
Fengzi vs Bonyth
Esports World Cup
6 days
ByuN vs Astrea
Lambo vs HeRoMaRinE
Clem vs TBD
Solar vs Zoun
SHIN vs Reynor
Maru vs TriGGeR
herO vs Lancer
Cure vs ShoWTimE
Liquipedia Results

Completed

2025 ACS Season 2: Qualifier
RSL Revival: Season 1
Murky Cup #2

Ongoing

JPL Season 2
BSL 2v2 Season 3
Copa Latinoamericana 4
Jiahua Invitational
BSL20 Non-Korean Championship
Championship of Russia 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters

Upcoming

CSL Xiamen Invitational
CSL Xiamen Invitational: ShowMatche
2025 ACS Season 2
CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
BSL Season 21
K-Championship
RSL Revival: Season 2
SEL Season 2 Championship
uThermal 2v2 Main Event
FEL Cracov 2025
Esports World Cup 2025
Underdog Cup #2
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 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.