472,341 Members | 2,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

abt white spaces n charecter arrays

well i need to deal with white spaces in charecter arrays...

with static arrays its fine..

char ss[50];

cin.getline(ss, sizeof ss);

.... //deals with white spaces

cout<<"Formatted ss :"<<ss;

but the problem m facing s with dynamic char array..

char * ss =new char;
now i cant use cin.getline(..) here as i declared pointer....and using cin eleminates the possiblity f dealn with white spaces as it ignores white spaces..

using string s also not helpful..

Apr 1 '07 #1
3 1809
9,065 Expert Mod 8TB
char * ss =new char;
now i cant use cin.getline(..) here as i declared pointer
Yes you can, cin takes a char * as input.
I suggest you check the getline reference.
Apr 1 '07 #2
ok fine..thnx but since i have to use the size limit n getline....the usefulnss f dynamic array is rendered useless as how wld i know bfore hand the no f chars to entrd durin run time.....
Apr 1 '07 #3
okies i fixed....using string instead f char*...

string ss;


thnx admin....
Apr 1 '07 #4

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

Similar topics

by: qwweeeit | last post by:
Hi all, I need to limit as much as possible the lenght of a source line, stripping white spaces (except indentation). For example: .. . ...
by: ucfcpegirl06 | last post by:
Hi, I need help getting rid of trailing white spaces. I am searching a file for various data (not important) and retrieving it. I output the data...
by: gopal srinivasan | last post by:
Hi, I have a text like this - "This is a message containing tabs and white spaces" Now this text contains tabs and...
by: Durgesh Sharma | last post by:
Hi All, Pleas help me .I am a starter as far as C Language is concerned . How can i Right Trim all the white spaces of a very long (2000 chars)...
by: Prince | last post by:
I have some <RequiredFieldValidator> on my page and everything works fine except that there are lots of white spaces between the web server...
by: Andreas Prilop | last post by:
How many spaces should be displayed in A <span style="display:none">x</span> B between "A" and "B"? I notice that Mozilla displays one space...
by: JA | last post by:
Is there a way to remove all the white space in the fields? I have been using Find-and-replace - looking for 2 or 3 or 4 or 10 spaces and...
by: iloveyousosomuch | last post by:
how do i erase extra white spaces and vowels in c without using string or arrays? I just have to use char... how do i do that?
by: ayan4u | last post by:
ok i have two problems... firstly in strict C enviornment is it possible to have a true dynamic charecter array with no predefined length...i...
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

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.