assigning string to int
From: Ben (crescent_au_at_yahoo.com)
Date: 05/29/04
- Next message: JKop: "Re: REFERENCES REVEALED"
- Previous message: Jeff Relf: "The = symbol " binds "."
- Next in thread: Mike Wahler: "Re: assigning string to int"
- Reply: Mike Wahler: "Re: assigning string to int"
- Reply: Petec: "Re: assigning string to int"
- Reply: JKop: "Re: assigning string to int"
- Reply: DigitaluX: "Re: assigning string to int"
- Reply: DigitaluX: "Re: assigning string to int"
- Reply: Michael Schutte: "Re: assigning string to int"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 May 2004 09:48:55 -0700
Hi all,
I would like to know if there is an easy way to assign a string to an int.
I have a struct such as:
struct Values {
int a;
int b;
}
I have 2 strings that i read from a file:
string x = "12";
string y = "10";
Now I'd like to do something like this:
Values val;
val.a = x;
val.b = y;
There is of course a mis-match.. How do I fix it? Is there an easy way?
Thanx for help!
Ben
- Next message: JKop: "Re: REFERENCES REVEALED"
- Previous message: Jeff Relf: "The = symbol " binds "."
- Next in thread: Mike Wahler: "Re: assigning string to int"
- Reply: Mike Wahler: "Re: assigning string to int"
- Reply: Petec: "Re: assigning string to int"
- Reply: JKop: "Re: assigning string to int"
- Reply: DigitaluX: "Re: assigning string to int"
- Reply: DigitaluX: "Re: assigning string to int"
- Reply: Michael Schutte: "Re: assigning string to int"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|