473,324 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

How to escape single quota in char * string

Hi there,
I got a char * pointer to some data and I was wondering how to replace
single quota, any ideas ? thanks
May 14 '08 #1
5 2638
arnaudk
424 256MB
I guess you mean you have an array of characters and want to replace any single quotes " ' " in that array? If you're using C++, it would be much easier to put your data in a C++ string, then you can use its many easy and powerful search and replace functions. In C, iterate through the array until the terminating null, testing for single quotes at each step.
May 14 '08 #2
Sick0Fant
121 100+
use the ascii code for the single quote.
May 14 '08 #3
JosAH
11,448 Expert 8TB
use the ascii code for the single quote.
Please don't; if you run that thing on an EBCDIC machine it'll fail miserably.

kind regards,

Jos
May 14 '08 #4
Sick0Fant
121 100+
Please don't; if you run that thing on an EBCDIC machine it'll fail miserably.

kind regards,

Jos
Yeah... in case you own a mainframe go ahead and adjust for that. Otherwise, you'll more than likely be fine. o_0
May 14 '08 #5
JosAH
11,448 Expert 8TB
Yeah... in case you own a mainframe go ahead and adjust for that. Otherwise, you'll more than likely be fine. o_0
Murphy said it much better: "anything that can go wrong will go wrong". Always
leave out magic numbers from your code.

kind regards,

Jos
May 14 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Kit | last post by:
Hey there, and thanks for reading a newbie post. I have a lex assignment in which we are supposed to grab strings from a C source file, and print them out to the screen, with escaped characters...
7
by: teachtiro | last post by:
Hi, 'C' says \ is the escape character to be used when characters are to be interpreted in an uncommon sense, e.g. \t usage in printf(), but for printing % through printf(), i have read that %%...
2
by: junky_fellow | last post by:
N869 " Each of these escape sequences shall produce a unique implementation-defined value which can be stored in a single char object. The external representations in a text file need not be...
18
by: Steve Litvack | last post by:
Hello, I have built an XMLDocument object instance and I get the following string when I examine the InnerXml property: <?xml version=\"1.0\"?><ROOT><UserData UserID=\"2282\"><Tag1...
4
by: Guadala Harry | last post by:
I need to place the following into a string... How can I properly escape the % " / < and > characters? <table width="100%" border="0" cellspacing="0" cellpadding="4px" class="hfAll"></Table> ...
6
by: HK guy | last post by:
In C#, it has a escape chatacter @ then can ingnore all the escape charactrer in string, how about in VB.NET, any escape character like @? Thank you
3
by: Tiger Champ | last post by:
hi all, I want to output something this way: Select 'This is 'A' book' from ... how to do this?
3
by: qilin | last post by:
I am trying to save a big text string into MySQL, but I guess i need escape the string firstly, anybody knows any escape function in c for that? or any other suggests ?
5
by: vlsidesign | last post by:
The printf function returns "warning: unknown escape sequence: \040" for a backslash-space combination. If the ascii decimal number for space is 32 and the backslash is 92, why this particular...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.