Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
what is the difference between these statement
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Ben Bacarisse, post: 5021704"] <snip everything> You were not commenting on what I wrote (that's fine)so you could have cut it out. It makes reading news simpler if messages contain only what they need to contain. I have re-formatted your code. Isn't it much nicer like this? It's worth paying attention to what your code looks like. arr is not a good name for any array. Apart from temporary counters like i, it's better to use names the describe the data. [i][i][i] Lets "play computer". The input is: two lines of text so your code does this: c i arr i = 0 't' arr[0] = 1 'w' arr[0] = 2 'o' arr[0] = 3 ' ' i = 1 'l' arr[1] = 1 'i' arr[1] = 2 'n' arr[1] = 3 'e' arr[1] = 4 's' arr[1] = 5 '\n' i = 2 'o' arr[2] = 1 'f' arr[2] = 2 ' ' i = 3 't' arr[3] = 1 'e' arr[3] = 2 'x' arr[3] = 3 't' arr[3] = 4 '\n' i = 4 EOF So, what has this achieved? It certainly does not look like it's collecting a histogram of word lengths. You won't be able to write a program until have a plan. You need to work out how you would do it if all you could see is the sequence of characters. Once you've done that, you can translate the plan into C. [/i][/i][/i] [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
what is the difference between these statement
Top