Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
string-arrays
- Page 1
Re: String Arrays
Programming
Software Development
16 Years Ago
by vmanes
… length of the longest word, in order to allocate the
string
arrays
, before storing the individual words. Be sure to place null…
Defining string arrays outside of their class
Programming
Software Development
16 Years Ago
by sindorei
…been having trouble with this theoretical issue of defining
string
arrays
(and even integers!) outside of their class. Here…> #include <
string
> using namespace std; class desu { public:
string
ok[4]; // Give
string
4 elements of space … make sure that I'm not screwing up with
string
arrays
) and i still get compile errors, eg: […
Trying to figure out how to change a couple string Arrays to Boolean arrays..
Programming
Software Development
17 Years Ago
by hemmysoft
… is Java. Anyway, I have been trying to change two
String
arrays
to Boolean's. I keep getting errors all the time…] = "first"; //Create the Second Class Array
String
class2Array[]; class2Array = new
String
[4]; //Put the desired data for each cell. class2Array…
Re: Defining string arrays outside of their class
Programming
Software Development
16 Years Ago
by sindorei
Ah, okay, thanks. I was under the impression that the bracket usage in defining
string
arrays
was simply a shorthand for manual initializing them one by one (ie, interchangable).
String arrays
Programming
Software Development
15 Years Ago
by ShadowScripter
…give you an example using Char
arrays
(having two dimensional since it's not like
string
) [CODE=cpp]char arrChar[][…null-terminated I approached the problem like so: [CODE=cpp]
string
arrString[] = { "I Like Turtles", &… here is the actual code: [CODE=cpp]int CountStructure(
string
*structure){ int counter = 0; for(int i =…
Re: String arrays
Programming
Software Development
15 Years Ago
by Narue
… array in bytes. Since std::
string
uses dynamic memory for the
string
contents, the size of each
string
object will be consistent, just… as if you used an array of pointers to char instead of
arrays
of…
Re: String arrays
Programming
Software Development
15 Years Ago
by siddhant3s
… use them: [code=cpp] int main(){ std::vector<std::
string
> vec1; vec1.push_back("Hello"); vec1.push_back("…);//see definition below } void f1(const std::vector<std::
string
> & vec) //a function taking vector as argument { for…
String Arrays
Programming
Software Development
16 Years Ago
by matt91turbo
… to start this program. I know how to create a
string
array, but I'm having trouble getting the overall structure… order, reverse order and backwards. Without using any C++ library
string
functions, print the number of letters in each word. Also…
Re: String Arrays
Programming
Software Development
16 Years Ago
by MosaicFuneral
Everything for using C-style strings is in
string
.h Here's a reference: [url]http://www.cplusplus.com/reference/clibrary/cstring/[/url]
Re: crack a cipher with string arrays
Programming
Software Development
15 Years Ago
by Salem
[url]http://cboard.cprogramming.com/cplusplus-programming/119344-crack-cipher-
string
-
arrays
.html[/url] Here's a FAQ [url]http://www.catb.org/~esr/faqs/smart-questions.html#forum[/url]
Re: string arrays: storing input
Programming
Software Development
17 Years Ago
by rem0404
… elements in the
arrays
const int MAX_SIZE = 100; /**** Function prototypes ****/ // Function: print // Parameters: // Functionality: void print(
string
[], int); // …: // Function: addMessage // Parameters: // Functionality: void addMessage(
string
[], int[], int,
string
, int); // Preconditions: int main() // Begin of main …
Re: string arrays: storing input
Programming
Software Development
17 Years Ago
by rem0404
… of elements in the
arrays
const int MAX_SIZE = 100; /**** Function prototypes ****/ // Function: print // Parameters: // Functionality: void print(
string
[], int); // Preconditions: … because we havent covered it yet: save void save(
string
file_in,
string
messages_in[], int keys_in[], int numElements_in) { // Declaring a…
Arrays and Methods
Programming
Software Development
13 Years Ago
by loupgarou
… other "capitals". I have to fill both these
String
arrays
using [B][U]ONE[/U][/B] method. I can handle…'s the capital...and so on. Do I create the
arrays
in the main method and pass them to readArray as… parameters? Or do I create the
arrays
inside of the readArray? I am completely lost with this…
string arrays: storing input
Programming
Software Development
17 Years Ago
by rem0404
… load function i have currently: [CODE]void load(
string
messages[], int keys[], int& numElements) { …int index = 0; int key;
string
message; while(index < MAX_SIZE && key …
arrays
. here's the addMessage function: [CODE]void addMessage(
string
messages[], int keys[], int numElements,
string
…
Re: string arrays: storing input
Programming
Software Development
17 Years Ago
by Ancient Dragon
>>are you saying i need to make numElements a call by reference parameter yes -- see below [code]void addMessage(
string
messages[], int keys[], [color=red]int& [/color]numElements,
string
message, int key) { [/code] you don't have to change load() at all.
Re: string arrays: storing input
Programming
Software Development
17 Years Ago
by rem0404
…[], int keys[], int& numElements) { int index = 0; int key;
string
message; while(index < MAX_SIZE && key > 0…
Re: string arrays: storing input
Programming
Software Development
17 Years Ago
by Ancient Dragon
This is what I mean. [code] void load(
string
messages[], int keys[], int& numElements) { int index = 0; int …key [color=red] = 1[/color];
string
message; while(index < MAX_SIZE && key > 0…
String arrays error
Programming
Software Development
13 Years Ago
by khanthegamer
… by the definition(or maybe by the initialisation of the
string
array). The error is comin in the vending.cpp file… quantity; public: vendingM(void); void displayList(); int quantityOfProducts(); void getItem(
string
); ~vendingM(void); }; #endif VENDING_HEADERer file [B]vending.cpp //cpp file…
String arrays and the Scanner class
Programming
Software Development
12 Years Ago
by Pobunjenik
…java.util.Scanner; public class Fakultet { public static void main(
String
[] args) { Scanner input = new Scanner(System.in); …grades = new int[theStudent.subjectNum]; theStudent.subjectNames = new
String
[theStudent.subjectNum]; for (int i=0; i<theStudent.…
Re: String arrays and the Scanner class
Programming
Software Development
12 Years Ago
by JamesCherrill
Parse: take some data in the form of a
string
and convert it into an integer or whatever. Java provides …standard ,methods for doing that, eg `Integer.parseInt(
String
s)` takes a
string
and interprets it as an integer, and returns that…
Re: String arrays and the Scanner class
Programming
Software Development
12 Years Ago
by JamesCherrill
… takes everything up to the end of line, is a
string
of zero length. You need to take or skip the…
Re: String arrays and the Scanner class
Programming
Software Development
12 Years Ago
by Pobunjenik
Acording to the pros, much like this:
String
parseFromThis = ""; for (int i=0; i<theStudent.…
Re: String arrays and the Scanner class
Programming
Software Development
12 Years Ago
by JamesCherrill
Yes, the second version is OK too - it's the one I would use because it's clearer than the version with the extra
String
variable
Re: Trying to figure out how to change a couple string Arrays to Boolean arrays..
Programming
Software Development
17 Years Ago
by hemmysoft
… requires commenting of everything! I need to CHANGE the
String
's all the Booleans. When I substitute the Strings …Now to your question, you cannot cast an array of
String
to an array of boolean. They're unrelated types. …You'll have to go through each
String
in that
String
array, determine whether it represents true or false, …
Re: Defining string arrays outside of their class
Programming
Software Development
16 Years Ago
by William Hemsworth
…like that, otherwise you have to assign the
string
to each array element seperatly like this:[CODE=…<iostream> #include <
string
> using namespace std; class desu { public:
string
ok[4]; } s; int main()… <iostream> #include <
string
> using namespace std; int main() {
string
ok[4] = {"one",…
Re: Trying to figure out how to change a couple string Arrays to Boolean arrays..
Programming
Software Development
17 Years Ago
by jwenting
…. Now to your question, you cannot cast an array of
String
to an array of boolean. They're unrelated types. You…'ll have to go through each
String
in that
String
array, determine whether it represents true or false, and…
Re: Defining string arrays outside of their class
Programming
Software Development
16 Years Ago
by sindorei
… examples do work for integers perfectly. I tried initializing that
string
array, in main().. however, it brought up more errors. Here…: [CODE]#include <iostream> #include <
string
> using namespace std; class desu { public:
string
ok[4]; } s; int main() { s…
Re: String arrays
Programming
Software Development
15 Years Ago
by ShadowScripter
Ah, thank you for the thorough explanations and examples Narue! siddhant3s, I don't know much about vectors, do you by any chance have a good link for a tutorial on them?
Re: string arrays nedd help
Programming
Software Development
14 Years Ago
by alaa sam
hi first when you need to use a
string
to need to include
string
library [CODE]#include<
string
>[/CODE] also you're getting error because you're using curly brackets in a wrong way delete some and you won't have errors delete the ones in line 20 & 26
Re: string array size
Programming
Software Development
18 Years Ago
by John A
[strlen](http://www.cplusplus.com/strlen) should work since you say you're using "
string
arrays
"
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC