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

86
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..

PLEASE HELP ASAP....
Apr 1 '07 #1
3 1809
Banfa
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
ayan4u
86
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
ayan4u
86
okies i fixed....using string instead f char*...

string ss;

getline(cin,ss);

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

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

Similar topics

5
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: .. . ...
4
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...
11
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...
9
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)...
3
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...
4
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...
12
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...
1
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?
2
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...
0
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...
0
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...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
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...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
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. ...
2
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...
0
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...
0
hi
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.