Question about Operating Systems

1 Answer

Programming exaples of string array,character array,data array,creating programand c++

Posted by on

  • Gene Wells May 11, 2010

    Not cetain what it is that you want... but there are plenty of sites on the Web with c++ examples.



    Geno

×

1 Answer

  • Level 3:

    An expert who has achieved level 3 by getting 1000 points

    Superstar:

    An expert that got 20 achievements.

    All-Star:

    An expert that got 10 achievements.

    MVP:

    An expert that got 5 achievements.

  • Master
  • 4,234 Answers

This sounds remarkably like a homework assignment type of question. Any C++ reference book will contain examples of this. Also, look for books about data structures which will contain not only examples of the above, but complete explanations of the concepts and uses of each.
Dan

Posted on Mar 26, 2008

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

How can I slove the error ERR:DATE TYPE when I try to run a program I have written?


You're attempting an operation that is not valid for a particular data type, like taking the square root of a string or extracting the second character of a floating-point number.
First, localize the error. Find the line number or location of the error, then narrow it down to the operation. Then examine the value(s) being used in that operation and their types. Make sure the operation is valid for that type(s).

Aug 01, 2013 | Operating Systems

Tip

How to create your own Run Command for any specific application?


Today tip will help you to make your own Run Command (program shortcut) to run a program or a document directly. No more need to navigate the location of a program or document to run it, simply click on Start button to open Run box and type the programs shortcut name to open it directly.
Follow the given steps to disable the save settings functionality for desktop:
To use this feature, you will need to be logged into your computer with administrative rights.
  • Click Start button and type regedit in Run option then press Enter for next.
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App paths
  • Now right click on App Paths and select New > Key, title the key and name it whatever you want your run command to be. In this case, we will try to create a run command for SecueCRT application.
  • New > Key > SecureCRT.exe
  • Now select the SecureCRT.exe folder and click right on (Default) string value then click Modify at the right hand side panel.
  • Here enter the path of the program that you want to execute in the value data field. In our case, the path of SecueCRT application will be C:\Program Files\VanDyke Software\SecureCRT \SecureCRT.exe.
  • Now again in right side panel, click right to create a new String value with the name SecureCRT and its values as C:\Program Files\VanDyke Software\SecureCRT\SecureCRT.exe
  • Now close the registry editor and restart your computer after any changes to go into effect.

on Jul 04, 2011 | Operating Systems

1 Answer

Define a character array and use strcpy() to copy a string into it. Print the string out by using a loop with a pointer to print out one character at a time. Initialize the pointer to the first element and...


Nice, computer science homework.
int main () { char str[]="this is my string";
//print our string forwards int i = 0; while(str[i]!="\0") { putchar( str[i] ); i++; }
//newline putchar('\n');
//print our string backwards int length = strlen(str); while(length--) { putchar( str[length] ); } }
I didn't test this to make sure it worked, but this is the general way of doing this. It looks like your professor wants you to use pointers. I used pointers here. Do you know how? Arrays are pointers with some syntactic sugar.
I wouldn't rely on sites like this to get answers to your homework. Even if you get the right answer, there's always the possibility of your CS professor finding this answer online and then making your future homework ten times harder.

Mar 01, 2011 | Operating Systems

2 Answers

Merging two arrays and sort them


NEED A NEW KEY THE ONE ON THE BOX WONT WORK

Jul 29, 2009 | Microsoft Windows XP Professional With...

1 Answer

I am an MCA student.To read the file from PC to handheld device


you might need to run a anti-virus through your computer. it might have a bug. :) hope this helps!!

May 20, 2009 | Microsoft Windows XP Professional

1 Answer

To merge two arrays A and B in java source code.


Do you need them to be sorted after the merge and are they already sorted? If not, then what you can do is create a temporary third array which will set the half of third array equal to the first array, and then set the set half equal to the second array. If they need to be sorted, I can help too but you need to tell me

public class ArrayMerge
{
public static int arr1[] = new int [20];
public static int arr2[] = new int [20];

public static void main()
{
setScores(arr1);
setScores(arr2);
printScores(arr1);
printScores(arr2);
printScores(merger(arr1,arr2));
}

public static void setScores(int a[])
{
for(int x = 0; x<a.length; x++)
{
a[x]= (int)(Math.random() * 100)+1;
}
}

public static void printScores(int a[])
{
for(int x = 0; x<a.length; x++)
{
System.out.print(a[x] + " ");
}
System.out.println();
}

public static int[] merger(int a1[], int a2[])
{
int a3[] = new int [(a1.length + a2.length)];

for(int x = 0; x<a1.length; x++)
{
a3[x]=a1[x];
}

for(int x = 0; x<a2.length; x++)
{
a3[x+a2.length]=a2[x];
}
return a3;
}
}

Jan 24, 2009 | Microsoft Windows XP Professional With...

1 Answer

Please explain the working of this code


It's a Java http server (webserver) that serves random "prices" if they match a search string.

Well here is an explaination:

private static String[] symbols = {"DELL", "INTC", "MSFT", "ORCL", "SUNW"};
These are search strings

private static Random rnd = new Random();
This generates a random number

private static Charset cs = Charset.forName("UTF-8");
This is the charset that the http server uses

ServerSocketChannel server = ServerSocketChannel.open();
Create a new server

server.socket().bind(new InetSocketAddress(8055));
Bind the http server to port 8055

The rest is handling the request and processing it

But here:
if(Arrays.binarySearch(symbols, symbol) >= 0)
response = "Price is " + (1000 + rnd.nextInt(9000)) / 100.0;
else
response = "Price not available";
channel.write(cs.encode("HTTP/1.0 200 OK "));
channel.write(cs.encode("Content-type: text/plain "));
channel.write(cs.encode(response));
channel.close();
}
It sees if the string input matchs: DELL INTC MSFT ORCL SUNW.

(private static String[] symbols = {"DELL", "INTC", "MSFT", "ORCL", "SUNW"};)
If so, it gives a price based on a random number.
(
response = "Price is " + (1000 + rnd.nextInt(9000)) / 100.0;)
Or else
It says "price not available"
then it gives a html header to end the error message.

Hope I helped you :)
Gook luck

Nov 26, 2008 | Operating Systems

2 Answers

Pattern matching


Nice try!

It's been almost 15 months since you asked your question.

If nobody has helped you with your "homework" assignment,
you probably scored a "zero" on your computer-programming course,
and probably no longer need an answer to your problem.

Sep 12, 2008 | Operating Systems

1 Answer

I need a program in turbo c that would count the vowels in the sentence using for loap


Here's an example:

//This is the array of characters that holds your sentence.
char YourSentance[];

//This is all of the Vowels, note that capitol and lower case are
//considered different.
char Vowels[]={'a','e','i','o','u','A','E','I','O','U'};

//This holds the counter of how many vowels we find
int NumVowels=0;

//Loop through the Sentence using i until we encounter a 0
//which signifies the end of the string
for(int i=0;YourSentance[i]!=0;i++) {
//Now loop through the vowels
for(int x=0;Vowels[x]!=0;x++) {
//Check to see if this character is a vowel
if(YourSentance[i]==Vowels[x]) {
//If it is, increment NumVowels, and end the loop early
NumVowels++;
break; // This line optional
}
}
}

//Now NumVowels contains a count of how many vowels
//we found
printf("There are %i vowels in the sentence.\n",NumVowels);

Feb 29, 2008 | Operating Systems

Not finding what you are looking for?
Operating Systems Logo

Related Topics:

150 people viewed this question

Ask a Question

Usually answered in minutes!

Top Operating Systems Experts

Les Dickinson
Les Dickinson

Level 3 Expert

18298 Answers

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

Prashant  Sharma
Prashant Sharma

Level 3 Expert

1127 Answers

Are you an Operating System Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...