• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 11:45
CEST 17:45
KST 00:45
  • 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
[ASL22] Ro8 Preview: Within Reach5[ASL22] Ro8 Preview: In A Tizzy11[ASL22] Ro16 Preview: Holy Diver5[ASL22] Ro16 Preview: Rough Waters10[ASL22] Ro24 Preview: Siren's Call8
Community News
StarCraft II 5.0.17 PTR Patch Notes (Sept 30, 2026)56Weekly Cups (Sept 21-27): herO and ByuN double2Weekly Cups (Sep 13-20): herO scores triple3BSL Season 2313Weekly Cups (Sep 7-12): SHIN, ByuN, MaxPax double down1
StarCraft 2
General
StarCraft II 5.0.17 PTR Patch Notes (Sept 30, 2026) How do you feel about the mass reverts in the 5.0.17 PTR? SC4ALL: II SC2 Complete Invited Player Lineup StarCraft open world shooter announced at BlizzCon Weekly Cups (Sept 21-27): herO and ByuN double
Tourneys
2026 GSTL Grand Finals Sea Duckling Open (Global, Bronze-Diamond) Stellar Fest TWO the Moon (Dec 16-20) SC2 INu's Battles#21 [ 3-Days tournament ] ScienceCraft (October 24-25) - Live Event
Strategy
[H] ZvP Mid-Late Game: Stalkers Collossi HT
Custom Maps
[M] (2) Sweltering Sands [M] (2) Frigid Storage
External Content
The PondCast: SC2 News & Results Mutation # 545 And Drops and Rifts Mutation # 544 Double Trouble Mutation # 543 Enhanced Defenses
Brood War
General
JaeDong's ASL S22 Ro. 8 Review Fantasy returning? BW General Discussion Bot on ladder ASL22 General Discussion
Tourneys
[ASL22] Ro8 Day 4 [Megathread] Daily Proleagues [ASL22] Ro8 Day 3 [ASL22] Ro8 Day 2
Strategy
Cliff Jump Revisited (1 in a 1000 strategy) Replay Review Process - What do you do? Simple Questions, Simple Answers Odyssey Mineral Stack Saturation
Other Games
General Games
Nintendo Switch Thread General RTS Discussion Thread Warcraft III: The Frozen Throne Stormgate/Frost Giant Megathread Total Annihilation Zero
Dota 2
Dota 2 Champions League Season 3 Begins April 25! Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Canadian Politics Mega-thread Artificial Intelligence Thread
Fan Clubs
Serral Fan Club
Media & Entertainment
Movie Discussion! [Manga] One Piece Diablo Animated Series on Netflix
Sports
Football (Soccer) Thread MLB/Baseball 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Recent Gifted Posts
Blogs
[ASL22] Ro4 Day1 Ticket Giv…
bITt.mAN
Escaping Into Video Games: G…
TrAiDoS
38 yo Retired SWE loo…
PurE)Rabbit-SF
Can Bots Beat Pros?? Starcr…
namkraft
[meme] I finally understa…
LUCKY_NOOB
Regacy Esports:Our Goa…
regacyesports
Customize Sidebar...

Website Feedback

Closed Threads



Active: 7766 users

[H] C programming

Blogs > Steelflight-Rx
Post a Reply
Steelflight-Rx
Profile Blog Joined July 2007
United States1389 Posts
October 27 2008 05:22 GMT
#1
I have a linked list, and I want to you a while loop.
while(a->next)

Would this loop break when a->next is null?

Sorry i've only really done java before, not really sure how while loops work in C.

yubee wrote: you know? it's a great night you should all smile no matter what harddships, because grass grows and the sky is blue and it's a good life.
R1CH
Profile Blog Joined May 2007
Netherlands10342 Posts
October 27 2008 05:25 GMT
#2
No, since that's the condition - you're essentially doing while (a->next != NULL)
AdministratorTwitter: @R1CH_TL
TL+ Member
IzzyCraft
Profile Blog Joined June 2007
United States4487 Posts
October 27 2008 05:28 GMT
#3
The loop would break if you put a variable that a > next such as A is a number and next is a char.
Or a is a int/double/long double and you input a character, but you can prevent that from breaking by use a ignore command
err umm.
cin >> a;
if( !cin)
{
cin.clear();
//cin.ignore();
cin.ignore(100, '\n');
}
But if your just incrementing a or something i doubt it would break normally =p ionno im very limited c knowlege T_T
I have ass for brains so,
even when I shit I'm droping knowledge.
R1CH
Profile Blog Joined May 2007
Netherlands10342 Posts
October 27 2008 05:39 GMT
#4
It's a pointer dereference, not a greater-than.
AdministratorTwitter: @R1CH_TL
TL+ Member
Steelflight-Rx
Profile Blog Joined July 2007
United States1389 Posts
Last Edited: 2008-10-27 05:41:32
October 27 2008 05:40 GMT
#5
oh that was my problem rich. i was putting null in lowercase. d'oh

thanks for the help
yubee wrote: you know? it's a great night you should all smile no matter what harddships, because grass grows and the sky is blue and it's a good life.
R1CH
Profile Blog Joined May 2007
Netherlands10342 Posts
October 27 2008 05:44 GMT
#6
Also I just re-read your OP, I misinterpreted your definition of break - as in, program will crash. Break as in exit the loop, yes it will.
AdministratorTwitter: @R1CH_TL
TL+ Member
Please log in or register to reply.
Live Events Refresh
Stellar Fest
13:00
Stellar Fest 2 The Moon: Qualifier Day 3
IntoTheiNu 1259
ComeBackTV 924
SteadfastSC859
TaKeTV 580
IndyStarCraft 168
Rex142
EnkiAlexander 80
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SteadfastSC 859
IndyStarCraft 168
Rex 142
ProTech132
BRAT_OK 31
MindelVK 12
StarCraft: Brood War
Britney 46584
Bisu 2310
EffOrt 978
Horang2 913
Soma 647
Shuttle 638
Mini 463
BeSt 457
Light 438
Larva 350
[ Show more ]
Hyuk 244
ZerO 201
Rush 198
firebathero 81
Mong 66
910 58
Sea.KH 56
Snow 53
Pusan 50
Liquid`Ret 47
Sexy 38
ToSsGirL 36
Trap 29
Aegong 24
Bale 24
Terrorterran 23
JYJ 23
Rock 16
Shine 14
Sacsri 12
ajuk12(nOOB) 9
yabsab 6
Dota 2
Gorgc8066
qojqva912
Counter-Strike
Fnx 834
fl0m469
Heroes of the Storm
crisheroes1421
Khaldor1218
Other Games
singsing1947
hiko1471
Beastyqt636
Livibee201
Hui .181
ArmadaUGS158
Liquid`VortiX136
KnowMe123
XaKoH 114
Mew2King82
QueenE71
DeMusliM13
ZerO(Twitch)11
CosmosSc2 2
Organizations
Other Games
BasetradeTV235
Dota 2
PGL Dota 2 - Main Stream80
StarCraft: Brood War
lovetv 10
[ Show 16 non-featured ]
StarCraft 2
• poizon28 38
• StrangeGG 34
• mYiSmile132
• Gemini_19 12
• Kozan
• AfreecaTV YouTube
• intothetv
• IndyKCrew
• Migwel
StarCraft: Brood War
• HerbMon 39
• Michael_bg 7
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
League of Legends
• Nemesis3838
Other Games
• Shiphtur300
Upcoming Events
OSC
6h 15m
CranKy Ducklings
18h 15m
Online Event
19h 15m
FEL
1d
AI Arena Tournament
1d 1h
BSL: Ladder Tournament
1d 3h
Sparkling Tuna Cup
1d 18h
INu's Battles
1d 20h
herO vs Classic
Percival vs Rogue
BSL Open Qualifier
2 days
BSL Open Qualifier
2 days
[ Show More ]
Replay Cast
2 days
Afreeca Starleague
2 days
Rush vs Light
WardiTV Weekly
2 days
Monday Night Weeklies
3 days
Replay Cast
3 days
Afreeca Starleague
3 days
Soma vs Soulkey
INu's Battles
3 days
SHIN vs Cure
ByuN vs Zoun
PiGosaur Cup
4 days
The PondCast
5 days
INu's Battles
5 days
Liquipedia Results

Completed

Proleague 2026-09-30
Blizzard Classic Cup 2026
Calamity Invitational

Ongoing

ASL Season 22
Super Anchor Qualifying S3
CSL 2026 AUTUMN (S22)
Acropolis #5
Stake Ranked Episode 4
1win Private Club #1
Logitech G Play Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #3
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual

Upcoming

Acropolis #5 - GSB
Acropolis #5 - GSC
BSL Season 23
SC4ALL II: Brood War
BSL 23: Non-Korean Championship
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
Custodian Cup
Copium Cup
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 2026
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
1win Private Club #2
Thunderpick World Champ. '26
ESL Pro League Season 24
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.