.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Programming
General Programming Help others and get yourself helped here!

Reply
 
Thread Tools
printf and \" issue
Old
  (#1)
Cpl. Shrike
ShrikeBot Coder/Moderator
 
Cpl. Shrike's Avatar
 
Status: Offline
Posts: 550
Join Date: Mar 2004
Location: The Netherlands
Default printf and \" issue - 14-05-2004

Howdy,

Im using this line of code in a CGI program this line prints an empty hmtl cell.

Code:
printf ("<TD width=\"40%\">&nbsp;</TD>")
edit/
the & n b s p ; is not showing up between the > < in the code tag
/edit

Well the thing is it compiled and worked fine using GCC on linux
No im trying to compile it in ecpilse work space. as far as i know eclipse just uses the GCC compiler however on build it complains with this message.

Unknown conversion type character `"'
In line 236 ( the line post above)

What confuses me is that it compiles/works on plain gcc and eclipse is complaining. Even while im using the escape char \ before the quote " char.

Is this line of code wrong after all. ?

Last edited by Cpl. Shrike; 14-05-2004 at 18:38..
  
Reply With Quote
Re: printf and /" issue
Old
  (#2)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: printf and /" issue - 14-05-2004

I have compiled that line of code in MSVC and Borland compiler and found no problem.
  
Reply With Quote
Re: printf and /" issue
Old
  (#3)
Cpl. Shrike
ShrikeBot Coder/Moderator
 
Cpl. Shrike's Avatar
 
Status: Offline
Posts: 550
Join Date: Mar 2004
Location: The Netherlands
Default Re: printf and /" issue - 14-05-2004

cool
didn't know about borland , don't have it.

Hmm leaves me with the question why eclipse don't accept it 8o
  
Reply With Quote
Re: printf and /" issue
Old
  (#4)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: printf and /" issue - 14-05-2004

could be because of the % sign. I don't even know what the % sign is for printf, because usually putting a % sign denotes that you want to place a variables value here (e.g. %d for an integer) maybe some compilers find it ok, but some dont.
  
Reply With Quote
Re: printf and /" issue
Old
  (#5)
Cpl. Shrike
ShrikeBot Coder/Moderator
 
Cpl. Shrike's Avatar
 
Status: Offline
Posts: 550
Join Date: Mar 2004
Location: The Netherlands
Default Re: printf and /" issue - 14-05-2004

Ahhh yes i get it...
The compiler is expecting a %d or %s etc etc.
It finds %" invalid.

But hmmm it should not take the " because the \ is in front. \"

Or maybe it wants to use the last " sign as an input for the single % sign.

/* think i'll sweep this problem under the eclips rug.
  
Reply With Quote
Re: printf and /" issue
Old
  (#6)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: printf and /" issue - 14-05-2004

For an ANSI integrist, that line is incorrect.
It should be
Code:
printf ("<TD width=\"40%%\"> </TD>")
because the % character is a special formatting character of printf() itself.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: printf and /" issue
Old
  (#7)
Cpl. Shrike
ShrikeBot Coder/Moderator
 
Cpl. Shrike's Avatar
 
Status: Offline
Posts: 550
Join Date: Mar 2004
Location: The Netherlands
Default Re: printf and /" issue - 14-05-2004

wujo
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com