Jump to content

help needed!!!

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
Guest_tarzan_dubya_*

Guest_tarzan_dubya_*
  • Guests
i being a total beginner need ur help

problem::write a program in C++ to read a set of lines and store them in array A.again read a string S and check whether the gven string is in the array A.
if it so, print that line and also how many times the string is repeated in the array A.

plz do this problem using just arrays and functions(simple).
don't use classes, structures,pointers and all other higher things
hoping for reply soon

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
1) do you know how to create an array?
2) do you know how to create an array of strings?
3) do you know how to use a for loop to traverse an array?
4) do you know how to compare strings?

Break the problem down into simple tasks, and deal with each task. Note: I gave you a hint in my questions.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
DevilsCharm

DevilsCharm

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 884 posts
I've been here for months and I still don't know what an array is. I'm a little more familiar on strings, though.

#4
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts

DevilsCharm said:

I've been here for months and I still don't know what an array is. I'm a little more familiar on strings, though.


Sidewinder said:

An array is a named place to store a SET of values allowing you to group common types.

Although its not the same syntax as C++ reading this should give you the idea of what an array is http://forum.codecal...ial-arrays.html

#5
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Are you familiar with what a matrix is? (The math one, not Keanu Reeves)
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#6
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
A matrix would be more of a multi-dimensional array. I like to concider an array just a indexed list.

#7
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
2 dimensional arrays are like a matrix. 1 dimensional arrays are like a row matrix. Both refer to their elements in about the same manner.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog