954,198 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Java to C++

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++ ?:-|

livingsword
Newbie Poster
18 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 
char* bname[] = { "Unix Environment",
                                         "Programming in Perl",
                                         "Comp. Architechture",
                                         "Operating System",
                                         "Java Programming",
                                         "DIstributed OS",
                                         "Database Management",
                                         "J2ME","Operating Systems",
                                         "Algorithms in C++"} ;
thekashyap
Practically a Posting Shark
811 posts since Feb 2007
Reputation Points: 254
Solved Threads: 75
 

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++"};
John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You