473,378 Members | 1,527 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,378 software developers and data experts.

convert one letter string to a char

4
i m having trouble with converting a string to a char

Expand|Select|Wrap|Line Numbers
  1. function(char thing, int x , int y){
  2. ..................
  3. }
  4.  
  5. int main(){
  6.    string input ;
  7.    function(input, 2,3) ;// does not work because it needs 
  8.                          //the first arg to be char    
  9. }

just a sample of what i m doing:

the real stuff i use:

function("I",2,3) ;

must be like

function("I",2,3) ; and so on
Dec 3 '11 #1
1 1956
johny10151981
1,059 1GB
You can access character the way you access array. Follow the link :
operator[]/
Dec 4 '11 #2

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

Similar topics

5
by: IamZadok | last post by:
Hi I was wondering if anyone knew how to convert a string or an integer into a Static Char. Thx
7
by: Bernardo | last post by:
Hi There is any easy way to convert a 1Char string to a char variable string str="A" char ch=str.. Thanks for your help
15
by: Yifan | last post by:
Hi Does anybody know how to convert System::String* to char*? I searched the System::String class members and did not find any. Thanks Yifan
5
by: Alan Silver | last post by:
Hello, <dumb question> I am trying to do something similar to the following... string str = "Hello"; char c = (char)str.Substring(2,1); but the compiler complains that it cannot convert...
5
by: tienlx | last post by:
Hi all, I'm have a problem that i don't know how to convert object to char in C# . Does anybody know ? Thanks.
3
by: priyanka | last post by:
Hi there, I want to convert a String into integer. I get the string from a file using : string argNum; getline(inputStream,argNum); I now need to convert argNum into integer.
1
by: TDK02 | last post by:
Hi, I need someones help to Convert C++ strings to a C-style string (char*) in VC++ 6.0. What I need to do is something as follows. There is a string as, string sh = “hello”;
3
by: timor.super | last post by:
Hi group, how to convert a string to a vector of unsigned char ? I used to iterate trough the string to set the vector, but I think this is not the best way to do this. I'm a beginner with the...
4
by: tortuous801 | last post by:
Hello I am having trouble figuring out how to take a string input and ultimately convert each letter of the string into binary then print out the binary results then convert from binary back to a...
2
by: AndreasL | last post by:
Hi! I have a string passed to a methos via a string&. I would like to convert this to an unsigned long. How do I convert the string iterator to a char*? with all the error checking code...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel

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.