• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. How to have double quotes in sprintf?

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 143
  • Views 1696
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to have double quotes in sprintf?

SSR
SSR 6 months ago

Hi,

 

When I run the following its printing the cmd with the \ in it ("The final result is \"PASS\" !!!").

sprintf(cmd "The final result is \"PASS\" !!!")

 

But i'm expecting to have the following result. How could i modify the above line to print the following? I would like to have the PASS to have the double quotes as mentioned below.

"The final result is "PASS" !!!"

I'm trying to do the following and the memory usage portion of the following command requires to have the double quotes in it.

sprintf(cmd "bsub -I -q layout -n 24 -R "rusage[mem=128000] span[hosts=1]" calibredrv")

cid=ipcSkillProcess(cmd)

 

Thanks

Ram

  • Cancel
  • Andrew Beckett
    Andrew Beckett 6 months ago

    Ram,

    The string doesn’t actually contain the backslashes and does indeed just contain the quotation marks. If you do:

    printf(“%s\n” cmd)

    you won’t see the backslashes (just the quotation marks) because they are not actually present. The backslashes are required when adding a quotation mark within a literal string to prevent the quotation mark from ending the string. When values containing embedded quotation marks are shown as return values in the CIW or printed with println, then the embedded quotation marks are shown so that the displayed value could be copied and reused as valid input. 

    Andrew 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information