i wish to use this java code in c++.

String bname[] = { "Unix Environment", "Programming in Perl",  "Comp. Architechture", "Operating System", "Java Programming", "DIstributed OS","Database Management", "J2ME","Operating Systems", "Algorithms in C++"};

how do I initialize char array in c++ ?:-|

Recommended Answers

All 2 Replies

char* bname[] = { "Unix Environment",
                                         "Programming in Perl",
                                         "Comp. Architechture",
                                         "Operating System",
                                         "Java Programming",
                                         "DIstributed OS",
                                         "Database Management",
                                         "J2ME","Operating Systems",
                                         "Algorithms in C++"} ;

Depends what you want to do. The best way in C++ to do this would be like this:

#include <iostream>
#include <string> // useful for string manipulation

std::string bname[] = { "Unix Environment", "Programming in Perl",  "Comp. Architechture", "Operating System", "Java Programming", "DIstributed OS","Database Management", "J2ME","Operating Systems", "Algorithms in C++"};
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.