473,467 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

string problem

9 New Member
I wanna know about function that can be taken a string as one other than "argv".That means I didnt wanna read string char by char.i need to take whole string in one.
Jul 12 '07 #1
4 1471
devikacs
96 New Member
I wanna know about function that can be taken a string as one other than "argv".That means I didnt wanna read string char by char.i need to take whole string in one.
Do you mean you want to pass a string as a argument to a c/c++ function and name it different from argv or do you mean pass a string to main?

Passing a string to a function is no different from passing an array to a function. You can pass char[] to the function.
Jul 12 '07 #2
19831030
9 New Member
Do you mean you want to pass a string as a argument to a c/c++ function and name it different from argv or do you mean pass a string to main?

Passing a string to a function is no different from passing an array to a function. You can pass char[] to the function.
By using char array I cant take string as one.I use C lang & char array read word one by one.I wanna use strcmp method without usung argv & directly entering word.I use any other type.
Jul 12 '07 #3
devikacs
96 New Member
By using char array I cant take string as one.I use C lang & char array read word one by one.I wanna use strcmp method without usung argv & directly entering word.I use any other type.
String data type is a character array. Do you mean input a string as a word rather than character by character?
use scanf("%s",str);

If not pls try to specify what you are tyring to achieve
Jul 12 '07 #4
Meetee
931 Recognized Expert Moderator Contributor
By using char array I cant take string as one.I use C lang & char array read word one by one.I wanna use strcmp method without usung argv & directly entering word.I use any other type.
To be more specific, you can use

Expand|Select|Wrap|Line Numbers
  1. char * str;
  2. scanf("%s",str);
  3.  
This will read your whole string instead of character by character :)

Regards
Jul 12 '07 #5

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

Similar topics

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...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
4
by: MooMaster | last post by:
After some google searching on the forum I couldn't find any topics that seemed to relate exactly to my problem, so hopefully someone can help me out... I'm running python 2.4.1 on a local Win2K...
6
by: tommaso.gastaldi | last post by:
Hi, does anybody know a speedy analog of IsNumeric() to check for strings/chars. I would like to check if an Object can be treated as a string before using a Cstr(), clearly avoiding the time...
1
Atli
by: Atli | last post by:
The following small HowTo is a compilation of an original problem in getting some cookie-values through different methods of string-handling. The original Problem was posted as follows: As...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.