• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 13:16
CEST 19:16
KST 02:16
  • 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
[ASL19] Finals Recap: Standing Tall8HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Flash Announces Hiatus From ASL44Weekly Cups (June 23-29): Reynor in world title form?12FEL Cracov 2025 (July 27) - $8000 live event16Esports World Cup 2025 - Final Player Roster16Weekly Cups (June 16-22): Clem strikes back1
StarCraft 2
General
The SCII GOAT: A statistical Evaluation Statistics for vetoed/disliked maps Esports World Cup 2025 - Final Player Roster How does the number of casters affect your enjoyment of esports? Weekly Cups (June 23-29): Reynor in world title form?
Tourneys
RSL: Revival, a new crowdfunded tournament series [GSL 2025] Code S: Season 2 - Semi Finals & Finals $5,100+ SEL Season 2 Championship (SC: Evo) FEL Cracov 2025 (July 27) - $8000 live event HomeStory Cup 27 (June 27-29)
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma Mutation # 477 Slow and Steady
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Player “Jedi” cheat on CSL Help: rep cant save Flash Announces Hiatus From ASL BW General Discussion
Tourneys
[Megathread] Daily Proleagues [BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET The Casual Games of the Week Thread [BSL20] ProLeague LB Final - Saturday 20:00 CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile What do you want from future RTS games? Beyond All Reason
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
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine Trading/Investing Thread The Games Industry And ATVI
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread NBA General Discussion Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 600 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 European League
16:00
Swiss Groups Day 2
Krystianer vs sebesdesLIVE!
MaxPax vs Babymarine
SKillous vs Mixu
ShoWTimE vs MaNa
WardiTV766
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 399
BRAT_OK 89
JuggernautJason49
MindelVK 22
StarCraft: Brood War
Britney 23546
Sea 3077
Rain 3041
BeSt 122
Dewaltoss 81
Mind 40
sSak 26
zelot 21
sas.Sziky 18
scan(afreeca) 17
[ Show more ]
Aegong 13
GoRush 11
soO 10
Sacsri 9
yabsab 9
JulyZerg 6
IntoTheRainbow 4
Dota 2
Gorgc9094
qojqva3035
capcasts233
League of Legends
Dendi831
Counter-Strike
fl0m337
flusha282
Super Smash Bros
Mew2King153
Heroes of the Storm
Liquid`Hasu95
Other Games
FrodaN1744
ceh9488
Lowko356
crisheroes302
elazer179
Pyrionflax138
ArmadaUGS137
KnowMe126
Trikslyr68
QueenE54
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis6839
• Jankos1550
• TFBlade175
Other Games
• Shiphtur358
• imaqtpie39
Upcoming Events
Replay Cast
6h 44m
RSL Revival
16h 44m
herO vs SHIN
Reynor vs Cure
OSC
19h 44m
WardiTV European League
22h 44m
Scarlett vs Percival
Jumy vs ArT
YoungYakov vs Shameless
uThermal vs Fjant
Nicoract vs goblin
Harstem vs Gerald
FEL
22h 44m
Korean StarCraft League
1d 9h
CranKy Ducklings
1d 16h
RSL Revival
1d 16h
FEL
1d 22h
Sparkling Tuna Cup
2 days
[ Show More ]
RSL Revival
2 days
FEL
2 days
BSL: ProLeague
3 days
Dewalt vs Bonyth
Replay Cast
4 days
Replay Cast
4 days
The PondCast
5 days
Replay Cast
6 days
RSL Revival
6 days
Liquipedia Results

Completed

Proleague 2025-06-28
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
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
CCT Season 2 Global Finals
IEM Melbourne 2025
YaLLa Compass Qatar 2025

Upcoming

CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
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
FISSURE Playground #1
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.