![]() |
| | #1 |
| Registered User Join Date: Nov 2009
Posts: 1
| sorry, i have a question ? is it possible to declare a variable in types of string ? if it is then , how?? thank you! |
| hello everyone is offline | |
| | #2 |
| Hen-teaser Join Date: Sep 2009 Location: Ohio
Posts: 434
| char something[] = "hello!" Last edited by Epy; 11-22-2009 at 12:04 PM. Reason: brainfart |
| Epy is offline | |
| | #3 |
| Registered User Join Date: Nov 2009
Posts: 43
| or char *s = "hui"; |
| r00t is offline | |
| | #4 |
| Registered User Join Date: Apr 2006
Posts: 1,337
| No don't do that. That's only possible for backwards compatibility. Instead do this: Code: const char *s="can't change me";
__________________ It is too clear and so it is hard to see. A dunce once searched for fire with a lighted lantern. Had he known what fire was, He could have cooked his rice much sooner. |
| King Mir is offline | |
| | #5 |
| Registered User Join Date: Jul 2008
Posts: 95
| Try this: Code: char string[4]; strcpy(string, "This is King Arthur"); |
| valthyx is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Question about Cprogramming | abachler | General Discussions | 2 | 04-10-2008 09:34 AM |
| Wikipedia CProgramming Entry? | jverkoey | General Discussions | 9 | 07-27-2005 09:15 PM |
| #cprogramming | Dual-Catfish | A Brief History of Cprogramming.com | 8 | 05-04-2002 09:37 PM |
| David's CProgramming Theorem | DavidP | A Brief History of Cprogramming.com | 10 | 08-14-2001 12:29 AM |