• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 01:46
CET 07:46
KST 15:46
  • 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 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13
Community News
[TLMC] Fall/Winter 2025 Ladder Map Rotation13Weekly 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 RotterdaM "Serral is the GOAT, and it's not close" RSL Season 3 - RO16 Groups C & D Preview TL.net Map Contest #21: Winners
Tourneys
RSL Revival: Season 3 Sparkling Tuna Cup - Weekly Open Tournament Constellation Cup - Main Event - Stellar Fest Tenacious Turtle Tussle Master Swan Open (Global Bronze-Master 2)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 500 Fright night Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened
Brood War
General
FlaSh on: Biggest Problem With SnOw's Playstyle BGH Auto Balance -> http://bghmmr.eu/ What happened to TvZ on Retro? SnOw's ASL S20 Finals Review BW General Discussion
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL21] RO32 Group D - Sunday 21:00 CET [BSL21] RO32 Group C - Saturday 21:00 CET
Strategy
Current Meta PvZ map balance Simple Questions, Simple Answers How to stay on top of macro?
Other Games
General Games
Should offensive tower rushing be viable in RTS games? Path of Exile Clair Obscur - Expedition 33 Stormgate/Frost Giant Megathread Nintendo Switch Thread
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
Things Aren’t Peaceful in Palestine US Politics Mega-thread About SC2SEA.COM Russo-Ukrainian War Thread Canadian Politics Mega-thread
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread 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: 2256 users

c++ help? - Page 3

Blogs > tossinYoSalad
Post a Reply
Prev 1 2 3 All
PaiNt)
Profile Joined June 2009
United States38 Posts
October 14 2009 07:16 GMT
#41
compiling with -Wall may have brought up that error.
something like g++ -Wall project.cpp
tossinYoSalad
Profile Blog Joined May 2009
United States215 Posts
Last Edited: 2009-10-14 19:14:41
October 14 2009 19:10 GMT
#42
On October 14 2009 16:14 Slithe wrote:
The issue with c++ is that there are a lot of nuances to it that gives it a steeper learning curve. As a result, one is a lot more error-prone when writing c++ code.

Regarding the assignment inside a conditional, here's random example code where it might be used:

char[] str = "Hello TeamLiquid!"
char c;
for (int i = 0; (c=str[i]) != 0; i++) {
printf("Letter: %c", c);
}

From a stylistic point of view, I don't think it's usually a particularly good idea, but it would be inconsistent to treat the assignment differently just because it was placed inside a conditional statement.


Huh that does make a lot of sense actually lol. I'm just used to java where if the if() statement doesn't resolve to a boolean it doesn't compile. C++ is nice and I like the fact that you have more freedom and it compiles directly to machine language and all, but some things about it just frustrate me. Like the fact that you can't declare an array without having a definite size for it ( yes I tried using extern.)

Also thanks a ton to everyone who helped me out. You guys rock .

oh and Sonovbob didnt catch the error. Sorry aethereal. He found another error though .
ph33r
Profile Joined June 2007
Canada58 Posts
October 14 2009 20:08 GMT
#43
On October 15 2009 04:10 tossinYoSalad wrote:
Show nested quote +
On October 14 2009 16:14 Slithe wrote:
The issue with c++ is that there are a lot of nuances to it that gives it a steeper learning curve. As a result, one is a lot more error-prone when writing c++ code.

Regarding the assignment inside a conditional, here's random example code where it might be used:

char[] str = "Hello TeamLiquid!"
char c;
for (int i = 0; (c=str[i]) != 0; i++) {
printf("Letter: %c", c);
}

From a stylistic point of view, I don't think it's usually a particularly good idea, but it would be inconsistent to treat the assignment differently just because it was placed inside a conditional statement.


Huh that does make a lot of sense actually lol. I'm just used to java where if the if() statement doesn't resolve to a boolean it doesn't compile. C++ is nice and I like the fact that you have more freedom and it compiles directly to machine language and all, but some things about it just frustrate me. Like the fact that you can't declare an array without having a definite size for it ( yes I tried using extern.)

Also thanks a ton to everyone who helped me out. You guys rock .

oh and Sonovbob didnt catch the error. Sorry aethereal. He found another error though .


You can use vectors if you want to implement dynamic arrays, or use pointers, like:

int *ptr;
ptr = new int[5];
...
int *ptr2 = new int[10];
for ( ... ) ptr2[i] = ptr[i];
delete[] ptr;
b3h47pte
Profile Blog Joined May 2007
United States1317 Posts
October 14 2009 20:32 GMT
#44
On October 14 2009 15:43 EtherealDeath wrote:
nah C++ is pretty easy, although nowadays I suggest you learn Java or C#

EDIT: Although, if I recall correctly C# can execute up to 40 times slower than C++, and the JVM means Java is slower as well (but you would learn the details yourself in a Java course). Of course, efficiency usually won't matter too much... though I think most games are not made with Java/C# (WoW for instance is written in C++), but you would use a lot of C# and Java in other programming jobs.


if you want to do game programming i believe you should learn C++ but you can also do some C#/XNA stuff if you're more inclined to do so that way..

However I do believe more software jobs (outside of games) use C#/Java for newer stuff. At the place where i interned at, their old utilities were written in VB6 with the newer ones using C#.
tossinYoSalad
Profile Blog Joined May 2009
United States215 Posts
October 14 2009 21:25 GMT
#45
On October 15 2009 05:08 ph33r wrote:
Show nested quote +
On October 15 2009 04:10 tossinYoSalad wrote:
On October 14 2009 16:14 Slithe wrote:
The issue with c++ is that there are a lot of nuances to it that gives it a steeper learning curve. As a result, one is a lot more error-prone when writing c++ code.

Regarding the assignment inside a conditional, here's random example code where it might be used:

char[] str = "Hello TeamLiquid!"
char c;
for (int i = 0; (c=str[i]) != 0; i++) {
printf("Letter: %c", c);
}

From a stylistic point of view, I don't think it's usually a particularly good idea, but it would be inconsistent to treat the assignment differently just because it was placed inside a conditional statement.


Huh that does make a lot of sense actually lol. I'm just used to java where if the if() statement doesn't resolve to a boolean it doesn't compile. C++ is nice and I like the fact that you have more freedom and it compiles directly to machine language and all, but some things about it just frustrate me. Like the fact that you can't declare an array without having a definite size for it ( yes I tried using extern.)

Also thanks a ton to everyone who helped me out. You guys rock .

oh and Sonovbob didnt catch the error. Sorry aethereal. He found another error though .


You can use vectors if you want to implement dynamic arrays, or use pointers, like:

int *ptr;
ptr = new int[5];
...
int *ptr2 = new int[10];
for ( ... ) ptr2[i] = ptr[i];
delete[] ptr;



Yeah I could have done that but it was unnecessary as it just required a two-dim array of fixed size. It created a problem because I wanted to have all references to the size of the array come from a single method, and you cannot do this upon creating the array (apparently). It wasn't a huge issue but it just irked me because I couldn't follow basic good programming principles.
Prev 1 2 3 All
Please log in or register to reply.
Live Events Refresh
Replay Cast
23:00
WardiTV Mondays #59
LiquipediaDiscussion
BSL 21
20:00
ProLeague - RO32 Group D
JDConan vs Semih
Dragon vs Dienmax
Tech vs NewOcean
TerrOr vs Artosis
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
NeuroSwarm 122
trigger 27
StarCraft: Brood War
hero 2189
Shuttle 1028
Zeus 492
Leta 329
yabsab 60
Sharp 41
Dota 2
monkeys_forever507
XaKoH 274
League of Legends
JimRising 683
Reynor27
Other Games
summit1g19464
WinterStarcraft356
C9.Mang0217
Fuzer 127
ViBE94
Organizations
StarCraft: Brood War
UltimateBattle 96
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• Berry_CruncH69
• practicex 33
• Migwel
• sooper7s
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• ZZZeroYoutube
• STPLYoutube
• BSLYoutube
League of Legends
• Scarra1615
• Rush1468
• Lourlo953
• Stunt404
• HappyZerGling142
Upcoming Events
Wardi Open
5h 15m
Monday Night Weeklies
10h 15m
Replay Cast
16h 15m
WardiTV Korean Royale
1d 5h
BSL: GosuLeague
1d 14h
The PondCast
2 days
Replay Cast
2 days
RSL Revival
3 days
herO vs Zoun
Classic vs Reynor
Maru vs SHIN
MaxPax vs TriGGeR
BSL: GosuLeague
3 days
RSL Revival
4 days
[ Show More ]
WardiTV Korean Royale
4 days
RSL Revival
5 days
WardiTV Korean Royale
5 days
IPSL
5 days
Julia vs Artosis
JDConan vs DragOn
RSL Revival
6 days
Wardi Open
6 days
IPSL
6 days
StRyKeR vs OldBoy
Sziky vs Tarson
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2025-11-14
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
CSCL: Masked Kings S3
SLON Tour Season 2
RSL Revival: Season 3
META Madness #9
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

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
IEM Kraków 2026
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.