• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 10:43
CET 16:43
KST 00:43
  • 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
Weekly Cups (Nov 3-9): Clem Conquers in Canada2SC: Evo Complete - Ranked Ladder OPEN ALPHA8StarCraft, SC2, HotS, WC3, Returning to Blizzcon!45$5,000+ WardiTV 2025 Championship7[BSL21] RO32 Group Stage4
StarCraft 2
General
Mech is the composition that needs teleportation t SC: Evo Complete - Ranked Ladder OPEN ALPHA Weekly Cups (Nov 3-9): Clem Conquers in Canada Craziest Micro Moments Of All Time? RotterdaM "Serral is the GOAT, and it's not close"
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
FlaSh on: Biggest Problem With SnOw's Playstyle BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ [ASL20] Ask the mapmakers — Drop your questions Where's CardinalAllin/Jukado the mapmaker?
Tourneys
[Megathread] Daily Proleagues [ASL20] Grand Finals [BSL21] RO32 Group A - Saturday 21:00 CET [BSL21] RO32 Group B - Sunday 21:00 CET
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
Stormgate/Frost Giant Megathread Nintendo Switch Thread Should offensive tower rushing be viable in RTS games? Path of Exile Dawn of War IV
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
Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine US Politics Mega-thread 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: 1873 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
WardiTV Korean Royale
12:00
Group Stage 1 - Group B
WardiTV1055
TKL 377
Rex113
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
TKL 377
Rex 113
StarCraft: Brood War
Calm 4124
Shuttle 1037
Soma 1020
Hyuk 577
firebathero 481
Stork 455
ZerO 453
hero 193
Rush 185
Sharp 119
[ Show more ]
sSak 109
Barracks 102
Killer 81
Sea.KH 58
Aegong 45
Mong 37
Backho 35
ToSsGirL 27
Free 21
zelot 18
Terrorterran 16
Sexy 16
Movie 15
Shine 13
Dota 2
singsing2439
Dendi1177
BananaSlamJamma162
XcaliburYe118
Counter-Strike
markeloff109
oskar98
FunKaTv 21
Other Games
B2W.Neo901
hiko660
DeMusliM366
Hui .323
Lowko312
crisheroes284
Fuzer 198
Sick176
Liquid`VortiX151
ArmadaUGS130
ZerO(Twitch)16
Trikslyr8
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• poizon28 16
• Adnapsc2 8
• Kozan
• Migwel
• AfreecaTV YouTube
• sooper7s
• Reevou 0
• intothetv
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• HerbMon 22
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 2333
• WagamamaTV404
League of Legends
• Nemesis3547
• TFBlade767
Upcoming Events
OSC
17m
Replay Cast
7h 17m
Replay Cast
17h 17m
Kung Fu Cup
20h 17m
Classic vs Solar
herO vs Cure
Reynor vs GuMiho
ByuN vs ShoWTimE
Tenacious Turtle Tussle
1d 7h
The PondCast
1d 18h
RSL Revival
1d 18h
Solar vs Zoun
MaxPax vs Bunny
Kung Fu Cup
1d 20h
WardiTV Korean Royale
1d 20h
PiGosaur Monday
2 days
[ Show More ]
RSL Revival
2 days
Classic vs Creator
Cure vs TriGGeR
Kung Fu Cup
2 days
CranKy Ducklings
3 days
RSL Revival
3 days
herO vs Gerald
ByuN vs SHIN
Kung Fu Cup
3 days
BSL 21
4 days
Tarson vs Julia
Doodle vs OldBoy
eOnzErG vs WolFix
StRyKeR vs Aeternum
Sparkling Tuna Cup
4 days
RSL Revival
4 days
Reynor vs sOs
Maru vs Ryung
Kung Fu Cup
4 days
WardiTV Korean Royale
4 days
BSL 21
5 days
JDConan vs Semih
Dragon vs Dienmax
Tech vs NewOcean
TerrOr vs Artosis
Wardi Open
5 days
Monday Night Weeklies
6 days
WardiTV Korean Royale
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
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
BLAST Rivals Fall 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.