473,388 Members | 1,234 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

array ouput

281 100+
Hello...I still do need help about my output array ( I once posted this question before).
My idea is to print all the output one short after the program has finished calculate many inputs. So I initiliaze output into an array.
I just got null from the output array...then now there is an error...
help me to tackle this problem please...thank you.
Expand|Select|Wrap|Line Numbers
  1. for(int ind=0; ind < 3; ind += 2)  
  2.  {
  3.    ....          
  4.    switch (opcode) 
  5.    {           
  6.               case GCD:       out = b1.gcd(b2).toString();
  7.                                    break;
  8.               default:        throw new BigAlException("invalid operation");
  9.     }  
  10.               String[] output = new String[5];
  11.               output[ind] = { ""+out };  //illegal start of exp.
  12.  
  13.           }      
  14.         System.out.println(output);
May 2 '07 #1
1 1225
JosAH
11,448 Expert 8TB
Hello...I still do need help about my output array ( I once posted this question before).
My idea is to print all the output one short after the program has finished calculate many inputs. So I initiliaze output into an array.
I just got null from the output array...then now there is an error...
help me to tackle this problem please...thank you.
Expand|Select|Wrap|Line Numbers
  1. for(int ind=0; ind < 3; ind += 2)  
  2.  {
  3.    ....          
  4.    switch (opcode) 
  5.    {           
  6.               case GCD:       out = b1.gcd(b2).toString();
  7.                                    break;
  8.               default:        throw new BigAlException("invalid operation");
  9.     }  
  10.               String[] output = new String[5];
  11.               output[ind] = { ""+out };  //illegal start of exp.
  12.  
  13.           }      
  14.         System.out.println(output);
Remove the curly brackets in the assignment expression:
Expand|Select|Wrap|Line Numbers
  1. output[ind]= ""+out;
They were a leftover from a previous question. Removing those brackets gets rid
of the compiler error diagnostic but I have no idea what that piece of code is all
about.

kind regards,

Jos
May 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Kyle Maddison | last post by:
Hi, I would like to access an array via an index I have in a string. I know I can pull the string apart and manually access it but that just looks ugly to me :) $pg = "foo@bar.com";...
1
by: Frits v/d Laan | last post by:
Hi I cannot figure out how to import an array from PHP into Javascript MyPHPcode is like this <?php $i=0; While ($i < $num) { $PHPvar= (" $PHPvar \" $Mystring \" , "); $i++;
1
by: serj | last post by:
Hello, I try to edit an array of double (or whatever type) allocated in the managed code from the unmanaged code. Is it possible ? I have an unsupported exception with the below code. void...
2
by: Potiuper | last post by:
Question: Is it possible to use a char pointer array ( char *<name> ) to read an array of strings from a file in C? Given: code is written in ANSI C; I know the exact nature of the strings to be...
4
by: tasahmed | last post by:
Hello Friends, I wrote a function which scans the current working directory and lists out details such as directory/file owner, permission etc. The output of this script can be viewing in the...
3
by: hefty1985 | last post by:
Hi Guys, I am new to this web. I have a fairly simple problem. I have an array of certain double precision numbers. What would be the best way for execluding one of the array members without...
4
by: hefty1985 | last post by:
Hi Guys, I am trying to eliminate certain elements off an array or vector in C without affecting other elements. Any idea of how this can be done neatly. For example: Input Array : 8 7 6 5...
1
by: keith katthy | last post by:
Is it true I do like below, if I want to all data array? and the ouput is 2. How to know which array that computer take? #include <iostream> #include <conio.h> #include <cstdlib> #include...
5
by: AZRebelCowgirl73 | last post by:
I am trying to accomodate for negative numbers, and as long as the negative is not being used, I have no problems with my input() ouput() and add() functions. I have tried this two different ways,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.