GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 29-Apr-2005, 21:55
rubenryhan rubenryhan is offline
New Member
 
Join Date: Apr 2005
Posts: 2
rubenryhan is on a distinguished road

what is wrong???


can some1 plz tell me what da heck is wrong with the following bit of code??

CPP / C++ / C Code:
for(x=0;x<10;x++)
{ 
 if(x=0) cout<<"a";
  else if(x=9)cout<<"b";
         else cout<<"c";
}

what i need to do is, check the value of x, for this reason i am using an "if" statement, because depending upon the value of x, the screen display has to be different.


can some1 help me out???
Last edited by LuciWiz : 30-Apr-2005 at 04:20. Reason: Please insert your C++ code between [c++] & [/c++] tags
  #2  
Old 29-Apr-2005, 22:26
kobi_hikri's Avatar
kobi_hikri kobi_hikri is offline
Regular Member
 
Join Date: Apr 2005
Location: Israel
Posts: 431
kobi_hikri has a spectacular aura aboutkobi_hikri has a spectacular aura about

Comaparison in c :


You must use '==' when comparing, not '=' as you have done.

Best regards,
Kobi Hikri.
  #3  
Old 02-May-2005, 08:09
rubenryhan rubenryhan is offline
New Member
 
Join Date: Apr 2005
Posts: 2
rubenryhan is on a distinguished road

Thanks so much mate !!!


Quote:
Originally Posted by kobi_hikri
You must use '==' when comparing, not '=' as you have done.

Best regards,
Kobi Hikri.

i've got it right now ... thanks once again sir
take care
 
 

Recent GIDBlogObservations of Iraq by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Functions and Classes - Where did I go wrong? redmage C++ Forum 5 10-Apr-2005 18:31
Something's wrong w/my program. agentxx04 C Programming Language 1 07-Nov-2004 10:03
where am i going wrong? nkhambal C Programming Language 5 03-Aug-2004 07:36
Dropped By Google...What am I doing wrong? ademaskoo Search Engine Optimization Forum 6 30-Jul-2004 23:08
something wrong with this code loon MySQL / PHP Forum 5 07-Jul-2003 05:55

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 06:17.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.