Tagged Questions
0
votes
2answers
16 views
I'm trying to use the specific key ' in my binary converter program, but it creates a syntax error
Here's a part of the working code. I give you a few examples of the working comparisons, but the comparison with the apostrophe (') key just doesn't work. Any ideas on how to fix this?
...
0
votes
1answer
106 views
String Comparison in C strcmp
I have domain names stored in a 2 dimensional array of char
char domainNames[2][4096]= {"www.yahoo.com","java.sun.com"};
and I need to check if a given domain name stored in another array( char ...
-1
votes
1answer
51 views
Populating 2d array from sequential file [closed]
I am trying to assign values to a 2d array from a text files, this is what i have:
string line = "";
string temp = "";
string removechr = "{} ";
string sepchar = ",";
ifstream myfile("pt.txt", ...
0
votes
1answer
53 views
Compare same words
I'm new in programming in C and I got 2 problems. I have two string, then I need to split them into words and find out if both strings contains same words. I will explain it with my code.
Input:
"He ...
0
votes
2answers
92 views
How to input multi-word string in C
I have this program. I want to input multi-word strings in a 2-D array. But instead of input whole string in first array of 2-D array this program inputs the first three words of my String in the ...
0
votes
2answers
64 views
how to increase the size of 2d char array element size in c
char symbol[100][100];
for(i=0;i<n;i++)
{
printf("enter the symbol\n");
scanf("%s",&symbol[0][i]);
}
strncat(&symbol[0][0],"1",1);
output
for ex:-
in symbol[0][0] ...
-2
votes
1answer
39 views
append character to a two dimensional array value in c
char str1[50][50];
char str2[40]="1";
char str3[40];
for(i=0;i<5;i++)
{
printf("enter the value\n");
scanf("%c",&str1[0][i]); //entered values in zeroth row only ...
0
votes
2answers
82 views
Issues with 2D array and strings
I am trying to create a program that reads a file called words.dat that contains a word-list of 20 words separated by white-space and tells the number of matched words. However the word cannot be any ...
0
votes
2answers
119 views
initializing a 2D array from a file of string
This is my first time working with 2D arrays. I am have read a 4 lines of strings from a text file and extracted them character by character. I am having trouble initialing an array with those ...
0
votes
2answers
480 views
2D Arrays in Java Program
My program is supposed to gets a phrase from the user then returns to the user an encrypted code of their choice (either ROT13 or ATBASH) of the phrase they entered. My code compiles and everything ...
-1
votes
2answers
91 views
Correct syntax for inputing a String file into a 2D Array?
What is the correct syntax for creating a 2D array from a text file? This array must be string not char or int. None of the information I've found on this is for string, and I haven't been able to ...
1
vote
1answer
66 views
Double Parse into an 2D array or jagged array
I have a text file that consist of
name,definition;
name1,definition;
name2, definition;
i know how to split the the string that is being taken into the script from the text file but i dont know ...
0
votes
3answers
557 views
How to pass a 2d array of strings in C programming?
I am trying to find the lowest value in an integer array. Then displaying that value with the name of the person who has that score. I can find which value is the lowest adn display it with the index ...
0
votes
3answers
214 views
C : Array of strings - Can input only n-1 strings for an input size of n
I have to sort strings in a lexicographical order using the Bubble Sort technique without using any library functions. I have written the following code which is working fine in sorting the strings.
...
2
votes
4answers
83 views
Phrasing a long string to a 2d array PHP
I have a long string say "123~456!!!789~012!!!345~678!!!901~234!!!567~890!!!1234~5678". I have used to types of delimiter in this string ~ and !!! . Can anyone suggest me an efficient way to ...
3
votes
4answers
658 views
C language, how find the length of a word in a 2d array?
I am trying to make a condition for a for loop where i have to say (c<wordlength) but im not sure how to find the length of the word.
so lets say i have an arrary called...
char ...
0
votes
1answer
697 views
Passing a 2D array of strings to a function in c++
I'm trying to pass a 2d and single dimmension array of strings to a function but its not working.
my arrays are:
string 2Darray[100][100];
String 1Darray[100];
Now the function:
void ...
2
votes
2answers
93 views
C - Trying to find a char[] in a charArray[n][] and record the value of n
I'm trying to loop through fooArray search each entry for foo and increment fooCount in the appropriate entry. As it stands the string: H A P Y \0 is successfully input into both foo and fooArray[2] ...
1
vote
3answers
5k views
How to input a string in a 2d array in C?
If i want to take an input in a 2d array with each string in one row, and the next in the other(i.e. change the row on pressing enter). How can i do that in C. C doesnt seem to have convenient ...
0
votes
1answer
284 views
AS3: How can you get an Array name from string
I am trying to copy a 2D array in a temporary array to a permanent one. The problem is that the array it's trying to copy to is dynamic.
I was looking for a way to get string (the new arrays name) to ...
0
votes
1answer
414 views
Choose random String from two dimensional array?
So what I have is a 2d array with the name of the drink, and the price Test[Name][Price]:
public static final String[][] Test = ...
0
votes
1answer
794 views
C: Passing pointers: incompatible pointer type warning
I'm trying to pass a 2d-array (array of strings) to a function in C, but am running into an "incompatible pointer type" warning.
In function ‘main’:
warning: passing argument 1 of ‘addCodonstoHash’ ...
0
votes
1answer
423 views
Java - 2D String Arrays, Dynamic Table, & Null Pointer Exceptions
I am working on a Chomsky Normal Form(CNF) dynamic programming assignment which consists of
two parts(I,II): (I). having the user enter a grammar and (checking, accepting) if it is in
valid CNF form ...
0
votes
3answers
1k views
Converting ArrayList Strings of to Characters?
So I have an arrayList of Strings imputed by the user.I also have a 2d array of chars : private char[][] puzzle ; I need help changing the Strings to characters so I can enter them into the 2d array ...
0
votes
2answers
1k views
Writing a string and 2D Array to a .txt file - Java
I am trying to output a single string and 2D array into a .txt file and am running into issues and this is the last part of my project. The program should output a single line, comma-delimited, ...
0
votes
2answers
702 views
storing a string(char*) in 2d array
Say I have declared a 2d array like
char* array[30][30];
and what I am putting into it are strings, not all of length 30, like
char* string="test string";
I want to put each char of string into ...
1
vote
1answer
910 views
How to convert a 2d array in String to int?
My program is to input a txt file into a 2d array use to calculate and present some data.
my input file look like:
[Student], Exam1, Exam2, Exam3
may, 100, 100, 100
peter, 99, 60, 80
john, 100, ...
-2
votes
2answers
966 views
2d char array to string
I want to use a 2d char array and have more than one string:
char[,] str = new char[9,1000];
int i=0;
while (i < 9)
{
last[i] = str[i].ToString();
...
0
votes
3answers
1k views
How to use String arrays in 2D (String[][]) and to parse data in each space (specified element spot)?
I want to get a proxy list and parse it into an array of strings, txt is the proxy list, tmp[] is an array that has element in the form "ipaddr:port". ie. (tmp[] = {"i.p.i.p:port", "i.p.i.p:port", ...
0
votes
4answers
936 views
Concatenating 2 2D arrays in java?
I've got 2 2D arrays, one int and one String, and I want them to appear one next to the other since they have the same number of rows. Is there a way to do this? I've thought about concatenating but ...