#ChatGPT canvas issue when coding in c/c++ or similar

1 messages · Page 1 of 1 (latest)

past cragBOT
#

Reported by @cosmic moss

Bug Report: ChatGPT canvas issue when coding in c/c++ or similar
`Steps to Reproduce`

When AI generates a code in canvas, it always converts symbol \n in c-style string like “some string\n” to the real line break. Asking them to use escaped newline \ \n doesn’t help as escape character still appear in the final code as well

`Expected Result`

Show newline symbol in c-style string as is, e.g. printf( "%s\n", str_var );

`Actual Result`

printf( "%s
", str_var );

`Environment`

Windows 10, Chrome 139

#
Additional Information

Please provide relevant details to help resolve the issue, such as:

  • ChatGPT Shared Link (if applicable).
  • Screenshots or videos demonstrating the problem.

-# ➜ Need to contact support? Visit the OpenAI Help Center.

pallid jay
#

Canvas has always been awful, I don't use it.

You need to prompt your expectations. See another comment I just posted on a similar topic.
#1414563772072202341 message

For you:

Don't use canvas. Escaped characters in code must be left as-is. For example, don't process "\n" as a new line, or replace "\t" with a tab. This is literal code and must not be processed.

cosmic moss