• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 10:58
CET 16:58
KST 00:58
  • 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
Master Swan Open (Global Bronze-Master 2) Constellation Cup - Main Event - Stellar Fest Tenacious Turtle Tussle Sparkling Tuna Cup - Weekly Open Tournament $5,000+ WardiTV 2025 Championship
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: 1248 users

So I'm coding in C n stuff1 - Page 2

Blogs > evanthebouncy!
Post a Reply
Prev 1 2 All
BottleAbuser
Profile Blog Joined December 2007
Korea (South)1888 Posts
Last Edited: 2009-01-08 11:44:27
January 08 2009 11:43 GMT
#21
I got my own questions.

Why does main method traditionally return an int? What the bloody hell is it good for?

Aren't there algorithms that make use of recursion, which would be a big pain to turn into iterative implementations using stacks? I suppose the asymptotal speed and space would be the same, if that's what Bockit's professor was saying.

Oh, and fonger, most compilers these days automatically optimize tail and head recursion so that they don't uselessly fill up your stack.
Compilers are like boyfriends, you miss a period and they go crazy on you.
HeadBangaa
Profile Blog Joined July 2004
United States6512 Posts
January 08 2009 12:34 GMT
#22
On January 08 2009 19:56 Bockit wrote:
My professor would say that recursion tends to be the more 'elegant' solution, but is never better than iteration.

Tail recursion is just fine.
People who fail to distinguish Socratic Method from malicious trolling are sadly stupid and not worth a response.
Scorch
Profile Blog Joined March 2008
Austria3371 Posts
January 08 2009 12:48 GMT
#23
On January 08 2009 20:43 BottleAbuser wrote:
Why does main method traditionally return an int? What the bloody hell is it good for?

I'm not much of a C programmer, but I think it's being used for error handling. If everything works, you normally return 0. If not, you can return an error code to see what went wrong.
MasterOfChaos
Profile Blog Joined April 2007
Germany2896 Posts
January 08 2009 12:50 GMT
#24
Why does main method traditionally return an int?
-Because programs return an int(I'm not sure about the range. But I think 16bit)
This is usually only relevant for console programs, and mostly used to signal an error back to the calling program/script.

In general you will use mostly iteration in c, but recursion where necessary.
LiquipediaOne eye to kill. Two eyes to live.
Darth_Ihsahn
Profile Joined June 2007
Mexico138 Posts
Last Edited: 2009-01-08 17:45:52
January 08 2009 17:42 GMT
#25
On January 08 2009 16:00 GHOSTCLAW wrote:
Show nested quote +
On January 08 2009 13:39 b3h47pte wrote:
On January 08 2009 13:01 InRaged wrote:
Why are you learning C? :3
There are much better languages for beginners ;P


I started learning C++ when i was in 6th grade so I'm sure he will have no problem learning C.


C is really really good to learn depending on what you actually want to do. Embedded systems all use C, just because they tend to be speed dependent, and you're memory/processor constrained. C runs pretty fast (not like hand optimized coding "to the metal", but close enough ><;


I work writing code for microcontrollers and this is absolutely right. C has a good balance between speed/resources and portability.

To expand a bit on what MasterOfChaos said, you usually need a return value for your program (main method) when you execute it as a part of a batch process and you need to know whether it succeeded or not.

This is how IDEs work under the hood. They call the compiler for each source file in the project, if all succeeded, they call the linker, if there is no error, a "build successful" message is displayed.
What does not kill you makes you stronger.
Mastermind
Profile Blog Joined April 2008
Canada7096 Posts
January 08 2009 19:53 GMT
#26
On January 08 2009 21:34 HeadBangaa wrote:
Show nested quote +
On January 08 2009 19:56 Bockit wrote:
My professor would say that recursion tends to be the more 'elegant' solution, but is never better than iteration.

Tail recursion is just fine.

yes, as long as the language you are programming is uses tail call optimization. Not all of them do.
Prev 1 2 All
Please log in or register to reply.
Live Events Refresh
OSC
11:30
Mid Season Playoffs
Krystianer vs PercivalLIVE!
WardiTV1125
TKL 235
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
TKL 235
SteadfastSC 94
Rex 85
StarCraft: Brood War
Calm 3285
Rain 2279
Bisu 1720
Hyuk 1637
Horang2 920
Soma 531
Stork 334
Rush 299
Shuttle 188
Backho 101
[ Show more ]
Soulkey 79
sas.Sziky 53
Barracks 53
hero 39
Rock 35
zelot 23
sSak 23
Aegong 19
Killer 16
Terrorterran 11
Dota 2
Gorgc3723
qojqva1869
Dendi1212
BananaSlamJamma147
XcaliburYe101
Super Smash Bros
Mew2King91
Other Games
DeMusliM434
hiko380
Sick378
Hui .313
Fuzer 203
QueenE52
ceh949
Trikslyr13
Organizations
StarCraft: Brood War
Kim Chul Min (afreeca) 11
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• poizon28 11
• 3DClanTV 6
• LaughNgamezSOOP
• AfreecaTV YouTube
• sooper7s
• intothetv
• Migwel
• Kozan
• IndyKCrew
StarCraft: Brood War
• HerbMon 11
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 3073
• WagamamaTV442
League of Legends
• Nemesis4286
• TFBlade1021
Upcoming Events
Tenacious Turtle Tussle
7h 2m
The PondCast
18h 2m
RSL Revival
18h 2m
Solar vs Zoun
MaxPax vs Bunny
Kung Fu Cup
20h 2m
WardiTV Korean Royale
20h 2m
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.