• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 10:26
CEST 16:26
KST 23:26
  • 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
Tournament Spotlight: FEL Cracow 20257Power Rank - Esports World Cup 202577RSL Season 1 - Final Week9[ASL19] Finals Recap: Standing Tall15HomeStory Cup 27 - Info & Preview18
Community News
Google Play ASL (Season 20) Announced24BSL Team Wars - Bonyth, Dewalt, Hawk & Sziky teams10Weekly Cups (July 14-20): Final Check-up0Esports World Cup 2025 - Brackets Revealed19Weekly Cups (July 7-13): Classic continues to roll8
StarCraft 2
General
Power Rank - Esports World Cup 2025 Tournament Spotlight: FEL Cracow 2025 #1: Maru - Greatest Players of All Time I offer completely free coaching services What tournaments are world championships?
Tourneys
FEL Cracov 2025 (July 27) - $10,000 live event Esports World Cup 2025 $25,000 Streamerzone StarCraft Pro Series announced $5,000 WardiTV Summer Championship 2025 WardiTV Mondays
Strategy
How did i lose this ZvP, whats the proper response
Custom Maps
External Content
Mutation #239 Bad Weather Mutation # 483 Kill Bot Wars Mutation # 482 Wheel of Misfortune Mutation # 481 Fear and Lava
Brood War
General
Google Play ASL (Season 20) Announced [Update] ShieldBattery: 2025 Redesign Dewalt's Show Matches in China BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion
Tourneys
[Megathread] Daily Proleagues [BSL20] Non-Korean Championship 4x BSL + 4x China CSL Xiamen International Invitational [CSLPRO] It's CSLAN Season! - Last Chance
Strategy
Simple Questions, Simple Answers [G] Mineral Boosting Does 1 second matter in StarCraft?
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Total Annihilation Server - TAForever [MMORPG] Tree of Savior (Successor of Ragnarok) 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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread UK Politics Mega-thread Stop Killing Games - European Citizens Initiative Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread
Fan Clubs
INnoVation Fan Club SKT1 Classic Fan Club!
Media & Entertainment
[\m/] Heavy Metal Thread Anime Discussion Thread Movie Discussion! [Manga] One Piece Korean Music Discussion
Sports
Formula 1 Discussion 2024 - 2025 Football Thread TeamLiquid Health and Fitness Initiative For 2023 NBA General Discussion
World Cup 2022
Tech Support
Installation of Windows 10 suck at "just a moment" Computer Build, Upgrade & Buying Resource Thread
TL Community
TeamLiquid Team Shirt On Sale The Automated Ban List
Blogs
Ping To Win? Pings And Their…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Socialism Anyone?
GreenHorizons
Eight Anniversary as a TL…
Mizenhauer
Customize Sidebar...

Website Feedback

Closed Threads



Active: 608 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
BSL20 Non-Korean Champi…
14:00
Bracket Day 2 - Final
LiquipediaDiscussion
FEL
09:00
Cracow 2025
Clem vs Krystianer
uThermal vs SKillousLIVE!
Reynor vs MaNa
Lambo vs Gerald
RotterdaM1940
ComeBackTV 1725
IndyStarCraft 598
WardiTV384
CranKy Ducklings184
Rex152
3DClanTV 77
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 1940
IndyStarCraft 598
Rex 152
BRAT_OK 65
MindelVK 25
StarCraft: Brood War
Britney 48690
Horang2 5597
EffOrt 1401
Barracks 1380
Larva 1175
Stork 741
BeSt 632
firebathero 521
Soulkey 276
Hyun 211
[ Show more ]
Last 138
Rush 129
Dewaltoss 87
sorry 68
Shinee 67
Sharp 63
Sea.KH 58
Movie 55
sSak 52
Free 45
sas.Sziky 35
Shine 32
zelot 20
yabsab 19
Terrorterran 5
Dota 2
Gorgc4559
qojqva3450
XcaliburYe418
420jenkins228
LuMiX1
Counter-Strike
fl0m1577
sgares375
oskar176
Heroes of the Storm
Khaldor509
Other Games
B2W.Neo1764
Beastyqt1353
Hui .288
DeMusliM219
Fuzer 153
QueenE70
KnowMe37
Organizations
Other Games
BasetradeTV29
StarCraft: Brood War
Kim Chul Min (afreeca) 6
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• HeavenSC 57
• poizon28 19
• LaughNgamezSOOP
• AfreecaTV YouTube
• sooper7s
• intothetv
• Migwel
• Kozan
• IndyKCrew
StarCraft: Brood War
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 3760
• WagamamaTV814
League of Legends
• Nemesis2734
• Jankos1393
Upcoming Events
BSL20 Non-Korean Champi…
3h 34m
Bonyth vs Zhanhun
Dewalt vs Mihu
Hawk vs Sziky
Sziky vs QiaoGege
Mihu vs Hawk
Zhanhun vs Dewalt
Fengzi vs Bonyth
Wardi Open
20h 34m
Sparkling Tuna Cup
1d 19h
WardiTV European League
2 days
Online Event
2 days
uThermal 2v2 Circuit
3 days
The PondCast
3 days
Replay Cast
4 days
Korean StarCraft League
5 days
CranKy Ducklings
5 days
[ Show More ]
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

CSLPRO Last Chance 2025
Esports World Cup 2025
Murky Cup #2

Ongoing

Copa Latinoamericana 4
Jiahua Invitational
BSL 20 Non-Korean Championship
BSL 20 Team Wars
FEL Cracov 2025
CC Div. A S7
Underdog Cup #2
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25

Upcoming

ASL Season 20: Qualifier #1
ASL Season 20: Qualifier #2
ASL Season 20
CSLPRO Chat StarLAN 3
BSL Season 21
RSL Revival: Season 2
Maestros of the Game
SEL Season 2 Championship
WardiTV Summer 2025
uThermal 2v2 Main Event
HCC Europe
ESL Pro League S22
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
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.