Thundermax 0 Light Poster 11 Years Ago Hello guys, how can I make the first character of a string is stored in a char? example: char [20]: "hello"; char c: h; c 0 0 Share cmps 26 Light Poster 11 Years Ago char string[] = "Hello"; char c = string[0]; printf("%c",c); Is this what you want ? 0 0 Share mridul.ahuja 4 Coding Enthusiast 11 Years Ago // code for CodeBlocks #include <iostream> #include <string> using namespace std; int main() { char string[] = "Hello"; char c = string[0]; printf("%c",c); return 0; } 0 0 Share Share Facebook Twitter LinkedIn Reply to this topic Be a part of the DaniWeb community We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge. Sign Up — It's Free!
cmps 26 Light Poster 11 Years Ago char string[] = "Hello"; char c = string[0]; printf("%c",c); Is this what you want ? 0 0 Share
mridul.ahuja 4 Coding Enthusiast 11 Years Ago // code for CodeBlocks #include <iostream> #include <string> using namespace std; int main() { char string[] = "Hello"; char c = string[0]; printf("%c",c); return 0; } 0 0 Share