• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 13:10
CEST 19:10
KST 02:10
  • 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
[ASL21] Ro8 Preview Pt2: Progenitors4Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16[ASL21] Ro16 Preview Pt2: All Star10Team Liquid Map Contest #22 - The Finalists22
Community News
RSL Revival: Season 5 - Qualifiers and Main Event10Code S Season 1 (2026) - RO12 Results12026 GSL Season 1 Qualifiers25Maestros of the Game 2 announced92026 GSL Tour plans announced15
StarCraft 2
General
Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Code S Season 1 (2026) - RO12 Results Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun Team Liquid Map Contest #22 - The Finalists MaNa leaves Team Liquid
Tourneys
2026 GSL Season 2 Qualifiers Sparkling Tuna Cup - Weekly Open Tournament StarCraft Evolution League (SC Evo Biweekly) $1,400 SEL Season 3 Ladder Invitational RSL Revival: Season 5 - Qualifiers and Main Event
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
Mutation # 524 Death and Taxes The PondCast: SC2 News & Results Mutation # 523 Firewall Mutation # 522 Flip My Base
Brood War
General
Why there arent any 256x256 pro maps? BW General Discussion ASL21 General Discussion [ASL21] Ro8 Preview Pt2: Progenitors BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[ASL21] Ro8 Day 3 [Megathread] Daily Proleagues [ASL21] Ro8 Day 2 Escore Tournament StarCraft Season 2
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates What's the deal with APM & what's its true value Any training maps people recommend?
Other Games
General Games
Stormgate/Frost Giant Megathread OutLive 25 (RTS Game) Daigo vs Menard Best of 10 Dawn of War IV Nintendo Switch Thread
Dota 2
The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
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
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread European Politico-economics QA Mega-thread 3D technology/software discussion Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion McBoner: A hockey love story
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Movie Stars In Video Games: …
TrAiDoS
ramps on octagon
StaticNine
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1153 users

The Big Programming Thread - Page 541

Forum Index > General Forum
Post a Reply
Prev 1 539 540 541 542 543 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.
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
Last Edited: 2014-10-31 15:11:30
October 31 2014 15:06 GMT
#10801
On October 31 2014 23:32 Nesserev wrote:
EDIT2: Question to the C wizards in this thread. If nothing is returned in a non-void function (like in this case), no compiler warnings seems to be given. Why? And what does it return, null?



http://stackoverflow.com/questions/10858391/why-do-programs-in-c-compile-even-when-the-return-statement-is-missing
Time is precious. Waste it wisely.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2014-10-31 15:17:13
October 31 2014 15:10 GMT
#10802
On October 31 2014 23:32 Nesserev wrote:
EDIT2: Question to the C wizards in this thread. If nothing is returned in a non-void function (like in this case), no compiler warnings seems to be given. Why? And what does it return, null?


if you don't return anything, if there's an assignment for the expected return i think the default behavior is to return the address of the function and cast to the assignment type.

(edit: hey sweet i got it right almost? is it just 0 or the function?)
There is no one like you in the universe.
Alzadar
Profile Blog Joined April 2010
Canada5009 Posts
Last Edited: 2014-10-31 15:15:38
October 31 2014 15:11 GMT
#10803
s is a pointer, so it will have a non-zero value pointing to a memory cell somewhere.

!s is false unless s was NULL. So when your function is passed a pointer that points to an empty string, it doesn't fall into that if statement.

This is similar to your problem with the while loops in your strjoin, maybe refresh your understanding of pointers?
I am the Town Medic.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
October 31 2014 15:19 GMT
#10804
On October 31 2014 23:47 Alzadar wrote:
Your strlen can't deal with an empty string.


the first line of the while loop (while s1[index]) deals with empty string fine.
There is no one like you in the universe.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2014-10-31 16:30:30
October 31 2014 15:22 GMT
#10805
You also should read up on the implicit <type> to bool casts C does, as frequently observed in if/while conditional statements. For example:

if(!s) implicity casts the pointer s to bool
equivalent to if(s == NULL)

if(!*s) implicity casts the char that s points to to bool
equivalent to if(*s == '\0')
If you have a good reason to disagree with the above, please tell me. Thank you.
Alzadar
Profile Blog Joined April 2010
Canada5009 Posts
Last Edited: 2014-10-31 15:26:24
October 31 2014 15:24 GMT
#10806
On November 01 2014 00:19 Blisse wrote:
Show nested quote +
On October 31 2014 23:47 Alzadar wrote:
Your strlen can't deal with an empty string.


the first line of the while loop (while s1[index]) deals with empty string fine.


Oh that's true actually, I misunderstood what the first check was trying to do and didn't really consider the loop. Never mind me, I'll go back to Tcl.

spinesheath I think you have some extra bangs there.
I am the Town Medic.
Cyx.
Profile Joined November 2010
Canada806 Posts
October 31 2014 15:31 GMT
#10807
On November 01 2014 00:10 Blisse wrote:
Show nested quote +
On October 31 2014 23:32 Nesserev wrote:
EDIT2: Question to the C wizards in this thread. If nothing is returned in a non-void function (like in this case), no compiler warnings seems to be given. Why? And what does it return, null?


if you don't return anything, if there's an assignment for the expected return i think the default behavior is to return the address of the function and cast to the assignment type.

(edit: hey sweet i got it right almost? is it just 0 or the function?)

Pretty sure it'll return whatever happens to be in EAX at the time (or however your compiler's calling convention does return values) - it's guaranteed UB though Your compiler should definitely give a warning if you have -Wall or equivalent on.
Cynry
Profile Blog Joined August 2010
810 Posts
October 31 2014 15:34 GMT
#10808
On November 01 2014 00:24 Alzadar wrote:
Show nested quote +
On November 01 2014 00:19 Blisse wrote:
On October 31 2014 23:47 Alzadar wrote:
Your strlen can't deal with an empty string.


the first line of the while loop (while s1[index]) deals with empty string fine.


Oh that's true actually, I misunderstood what the first check was trying to do and didn't really consider the loop. Never mind me, I'll go back to Tcl.

spinesheath I think you have some extra bangs there.

Nah man, you're still right kinda, I mixed the check for a pointer to NULL and the check for an empty string. Definitely some understanding issues, although I know all that :/
Alzadar
Profile Blog Joined April 2010
Canada5009 Posts
October 31 2014 15:52 GMT
#10809
re: pointer understanding, I know it helped me a lot to write

char* c
instead of
char *c

Just don't do this when declaring multiple variables on one line.
I am the Town Medic.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
October 31 2014 16:33 GMT
#10810
On November 01 2014 00:24 Alzadar wrote:
spinesheath I think you have some extra bangs there.

Oh wow, that was so stupid of me. Not only is it much simpler now, but also if I wanted to show how the negation works together with the implicit cast I should have written the following instead:
if(!(s != NULL))
If you have a good reason to disagree with the above, please tell me. Thank you.
ThatGuy
Profile Blog Joined April 2008
Canada695 Posts
October 31 2014 20:09 GMT
#10811
Crossposted from SFW funny pictures thread:

[image loading]
JD.
Profile Joined September 2014
Australia250 Posts
November 01 2014 08:14 GMT
#10812
Hey guys is anyone able to give me a hand with this?

*my code isn't 100% the same but if I can fix it here I can fix it on my end*

http://jsfiddle.net/be7tfczs/2/

Basically I want to be able to select a link and have the information pop up from imdb, but the code I have seems to use the first instance of "movie" all the time instead of the value associated with the link. I'm sure the solution is simple and I'm just not getting it
WolfintheSheep
Profile Joined June 2011
Canada14127 Posts
November 01 2014 08:34 GMT
#10813
On November 01 2014 17:14 JD. wrote:
Hey guys is anyone able to give me a hand with this?

*my code isn't 100% the same but if I can fix it here I can fix it on my end*

http://jsfiddle.net/be7tfczs/2/

Basically I want to be able to select a link and have the information pop up from imdb, but the code I have seems to use the first instance of "movie" all the time instead of the value associated with the link. I'm sure the solution is simple and I'm just not getting it

http://api.jquery.com/html/

Description: Get the HTML contents of the first element in the set of matched elements.


So basically, your $('.movie;).html() call just finds the first match and stops.

I think what you want is $(this).text()
Average means I'm better than half of you.
JD.
Profile Joined September 2014
Australia250 Posts
November 01 2014 12:03 GMT
#10814
Beautiful, thanks! I knew it was something simple haha.
MutantGenepool
Profile Joined October 2011
Australia115 Posts
November 02 2014 08:32 GMT
#10815
The Pros and Cons of Agile or Waterfall programming method of choice.

I looked up the P's and Q's about this, but I'd like to hear what TL'ers think.
Does Agile suit you as the way for programming or do you need to have a strict plan?
I'd like to hear what you folks think are the Pro's and Con's of each and what drives you to this way of programming.

Cheers
EGRevival (Zerg) has more marines than Polt. ROOTNathanias
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
November 02 2014 19:19 GMT
#10816
I've learned that strict plans usually fail. Customers tend to change their mind on stuff as you go and then you have to go back to stuff you already did and change it, creating delays that keep adding up until it becomes unmanagable as you have to skip stuff or do it poorly to meet the deadlines. With agile it's much easier to accomodate the unexpected. Like this last week, project was scheduled for deployment but 1 day before that the customer submitted 8 or so changes. No biggie.

http://www.agilenutshell.com/agile_vs_waterfall
Time is precious. Waste it wisely.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2014-11-02 23:22:04
November 02 2014 23:21 GMT
#10817
Agile is good for shit that you don't need long planning periods to build. Like tech start-up products. Or mobile apps. Or websites. Probably not great for building a spaceship. Or building a bridge. They're good for shit that you want to get out super quickly and get feedback. Like tech start-up products. Or mobile apps. Or websites. Probably not great for building bridges. Or building spaceships.
There is no one like you in the universe.
snakeeyez
Profile Joined May 2011
United States1231 Posts
Last Edited: 2014-11-03 00:35:42
November 03 2014 00:29 GMT
#10818
Agile methodology is just different terminology for what is commonly done many other ways already. Most ways of developing something involve on the fly changes and maybe shuffling things around. Just seems like calling a car an automobile to me your not really doing anything new.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
November 03 2014 00:57 GMT
#10819
you're gonna be a terrible automobile accessory salesman snakeeyez.
conspired against by a confederacy of dunces.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
November 03 2014 12:15 GMT
#10820
I want to get back into C++ development since the C++11 changes intrigue me and I haven't done any C++ work in ages and recently noticed how rusty I am in that regard. That is why I'm wondering which IDE is common these days. Back in the day I've used VIM and wrote Makefiles by hand and such, but these days I'd prefer to use a full IDE instead, so which IDE (using Windows) would you recommend?
Prev 1 539 540 541 542 543 1032 Next
Please log in or register to reply.
Live Events Refresh
Monday Night Weeklies
16:00
#50
RotterdaM663
TKL 261
IndyStarCraft 132
BRAT_OK 98
SteadfastSC95
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 663
TKL 261
IndyStarCraft 132
BRAT_OK 98
SteadfastSC 95
UpATreeSC 89
StarCraft: Brood War
Calm 4973
GuemChi 4550
Britney 2436
EffOrt 1442
Mini 710
ggaemo 600
BeSt 331
firebathero 233
Dewaltoss 176
Sharp 111
[ Show more ]
Barracks 90
Sexy 85
Zeus 74
Sea.KH 50
Hyun 39
PianO 39
ToSsGirL 32
zelot 29
Hm[arnc] 27
Pusan 26
soO 25
Rock 24
Movie 20
IntoTheRainbow 14
Terrorterran 13
ajuk12(nOOB) 8
Sacsri 7
Dota 2
Gorgc5371
420jenkins243
monkeys_forever242
BananaSlamJamma187
Counter-Strike
olofmeister1476
Super Smash Bros
Mew2King158
Other Games
Grubby3377
Liquid`RaSZi1082
FrodaN1066
Beastyqt1058
qojqva983
B2W.Neo872
ceh9478
byalli381
C9.Mang0156
ArmadaUGS150
Hui .112
elazer99
KnowMe99
Trikslyr52
MindelVK3
Organizations
Other Games
BasetradeTV426
Dota 2
PGL Dota 2 - Main Stream40
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 17 non-featured ]
StarCraft 2
• StrangeGG 49
• intothetv
• Kozan
• sooper7s
• Migwel
• AfreecaTV YouTube
• LaughNgamezSOOP
• IndyKCrew
StarCraft: Brood War
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• WagamamaTV464
League of Legends
• Nemesis2196
• Jankos1517
• TFBlade999
• imaqtpie477
Other Games
• Shiphtur221
Upcoming Events
Replay Cast
6h 51m
Sparkling Tuna Cup
16h 51m
Afreeca Starleague
16h 51m
Snow vs Flash
WardiTV Invitational
17h 51m
SHIN vs Nicoract
Solar vs Nice
GSL
1d 16h
Classic vs Cure
Maru vs Rogue
GSL
2 days
SHIN vs Zoun
ByuN vs herO
OSC
2 days
OSC
2 days
Replay Cast
3 days
Escore
3 days
[ Show More ]
The PondCast
3 days
WardiTV Invitational
3 days
Zoun vs Ryung
Lambo vs ShoWTimE
OSC
4 days
Replay Cast
4 days
CranKy Ducklings
4 days
RSL Revival
4 days
SHIN vs Bunny
ByuN vs Shameless
WardiTV Invitational
4 days
Krystianer vs TriGGeR
Cure vs Rogue
uThermal 2v2 Circuit
4 days
BSL
5 days
Replay Cast
5 days
Sparkling Tuna Cup
5 days
RSL Revival
5 days
Cure vs Zoun
Clem vs Lambo
WardiTV Invitational
5 days
BSL
6 days
Replay Cast
6 days
Afreeca Starleague
6 days
Liquipedia Results

Completed

Proleague 2026-05-02
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
Acropolis #4
SCTL 2026 Spring
RSL Revival: Season 5
2026 GSL S1
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026

Upcoming

YSL S3
Escore Tournament S2: W6
KK 2v2 League Season 1
BSL 22 Non-Korean Championship
Escore Tournament S2: W7
Escore Tournament S2: W8
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
2026 GSL S2
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
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 © 2026 TLnet. All Rights Reserved.