943,936 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1142
  • C++ RSS
Mar 5th, 2007
0

Java to C++

Expand Post »
i wish to use this java code in c++.

C++ Syntax (Toggle Plain Text)
  1.  
  2. 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++ ?:-|
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
livingsword is offline Offline
18 posts
since Jan 2007
Mar 5th, 2007
0

Re: Java to C++

  1. char* bname[] = { "Unix Environment",
  2. "Programming in Perl",
  3. "Comp. Architechture",
  4. "Operating System",
  5. "Java Programming",
  6. "DIstributed OS",
  7. "Database Management",
  8. "J2ME","Operating Systems",
  9. "Algorithms in C++"} ;
Last edited by thekashyap; Mar 5th, 2007 at 1:06 am.
Reputation Points: 254
Solved Threads: 74
Practically a Posting Shark
thekashyap is offline Offline
804 posts
since Feb 2007
Mar 5th, 2007
0

Re: Java to C++

Depends what you want to do. The best way in C++ to do this would be like this:
C++ Syntax (Toggle Plain Text)
  1. #include <iostream>
  2. #include <string> // useful for string manipulation
  3.  
  4. std::string bname[] = { "Unix Environment", "Programming in Perl", "Comp. Architechture", "Operating System", "Java Programming", "DIstributed OS","Database Management", "J2ME","Operating Systems", "Algorithms in C++"};
Team Colleague
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
John A is offline Offline
5,055 posts
since Apr 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: C++ program that checks if...
Next Thread in C++ Forum Timeline: Conversions





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC