473,418 Members | 2,052 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,418 software developers and data experts.

which is the better path

Question:
Write a function named sumarrays() that accepts two arrays that are the same
size. The function should add each element in the array together and place
the values in the thrid array.

Which answer is the better practice;

/*EX9.C*/
#include<stdio.h>
#define MAX 5

int array2[MAX] = {1,2,3,4,5};
int array3[MAX] = {6,7,8,9,10};
int sumarray(int array2[], int array3[]);

int main(void)
{
sumarray(array2,array3);
return 0;
}

int sumarray(int array2[], int array3[])
{
int ctr;
int total[MAX];

for(ctr = 0; ctr < MAX; ctr++)
{
total[ctr] = array2[ctr] + array3[ctr];
printf("Total %d\n",total[ctr]);
}
return total[count];
}
____________________________________________
/* EX9-1.C*/
#include<stdio.h>
#define SIZE 5

void sumarray(int [], int []);
int main(void)
{
int a[SIZE] = {1,2,3,4,5};
int b[SIZE] = {6,7,8,9,10};

sumarray(a,b);
return 0;
}

void sumarray(int first[], int second[])
{
int total[SIZE];
int ctr;

for(ctr = 0; ctr < SIZE; ctr++)
{
total[ctr] = first[ctr] + second[ctr];
printf("Total %d\n",total[ctr]);
}

}

Nov 14 '05
52 2231
Da*****@cern.ch (Dan Pop) writes:
In <cu*************@zero-based.org> Martin Dickopp <ex****************@zero-based.org> writes:
Da*****@cern.ch (Dan Pop) writes:

[...]


The lack of context *implies* a complete expression.


Until you provide some evidence that this is an established rule in this
newsgroup, I'll continue to disagree.
This makes your original statement wrong. Furthermore, your
original statement was true only in *exceptional* cases and wrong in the
rest of the cases.

Compare your original statement with its negation (both are false,
as such) and see which of them correctly covers more cases.


How can my original statement be wrong, true in exceptional cases, and
false at the same time? If it was true, even if only in exceptional
cases, it cannot also be wrong and false.


Of course it can. Consider the statement "it rains". Without aditional
context, it can be both true and false. If we manage to define a default
context, we can establish whether it's true or false.


If a statement can only be both true and false if there is no context,
and my original statement has been true and false, it follows that there
has been no context for my original statement.

Well, that's my point: My original statement has not been in a context
which would allow you to claim that it must be interpreted as a complete
expression.

Martin
--
,--. Martin Dickopp, Dresden, Germany ,= ,-_-. =.
/ ,- ) http://www.zero-based.org/ ((_/)o o(\_))
\ `-' `-'(. .)`-'
`-. Debian, a variant of the GNU operating system. \_/
Nov 14 '05 #51
In <cu*************@zero-based.org> Martin Dickopp <ex****************@zero-based.org> writes:
Da*****@cern.ch (Dan Pop) writes:
In <cu*************@zero-based.org> Martin Dickopp <ex****************@zero-based.org> writes:
Da*****@cern.ch (Dan Pop) writes:

[...]
The lack of context *implies* a complete expression.


Until you provide some evidence that this is an established rule in this
newsgroup, I'll continue to disagree.


Plenty of evidence in Google. Whenever someone asked or stated something
about an expression, he was talking about that expression and not about
anything else.
This makes your original statement wrong. Furthermore, your
original statement was true only in *exceptional* cases and wrong in the
rest of the cases.

Compare your original statement with its negation (both are false,
as such) and see which of them correctly covers more cases.

How can my original statement be wrong, true in exceptional cases, and
false at the same time? If it was true, even if only in exceptional
cases, it cannot also be wrong and false.


Of course it can. Consider the statement "it rains". Without aditional
context, it can be both true and false. If we manage to define a default
context, we can establish whether it's true or false.


If a statement can only be both true and false if there is no context,
and my original statement has been true and false, it follows that there
has been no context for my original statement.


Nope, your statement was false, which is what I have always told you.
It becomes true only if we invent a context for it, other than the default
context in which it was made.
Well, that's my point: My original statement has not been in a context
which would allow you to claim that it must be interpreted as a complete
expression.


There was no C code surrounding your expression, therefore it was a
complete expression.

You're trying to use Mark McIntyre's argumentation techniques to save your
ass after making an obviously false statement. They never worked for him
and they won't work for you. But they did buy him the reputation of
c.l.c's resident idiot and they might have the same effect for you, if you
insist in this direction...

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #52
Da*****@cern.ch (Dan Pop) writes:
There was no C code surrounding your expression, therefore it was a
complete expression.
I have already told you that is was not indended as a complete
expression. And while you have often repeated that a context free
expression *must* be interpreted as a complete expression, you have
never provided any proof that such a rule exists.
You're trying to use Mark McIntyre's argumentation techniques


Your argumentation technique is known as "proof by repretition". You
seem to think that, if you only state your /opinion/ that as context
free expression must be interpreted as a complete expression often
enough, it changes into a fact.

Martin
--
,--. Martin Dickopp, Dresden, Germany ,= ,-_-. =.
/ ,- ) http://www.zero-based.org/ ((_/)o o(\_))
\ `-' `-'(. .)`-'
`-. Debian, a variant of the GNU operating system. \_/
Nov 14 '05 #53

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bob Roberts | last post by:
How can I make it so that I can pass anything into os.system() any command that I would type into the command line (bash on cygwin)? For example, "lower" is a small script of mine that I use...
9
by: Robert Lario | last post by:
C# verses VB.Net Which Way to go. I am sure this issues has come up before. Please direct me to any good articles that cover this issue. Ideally some neutral assessment.
1
by: Pieter | last post by:
Hi, I have this Warning for several forms when using the DockPanel Suite of Weifen Luo in VS.NET 2005. I read a lot about this CLS-compliant stuff, but I don't now how to chech actually which...
2
by: Marty | last post by:
The Image web control works with the relative path supplied, but the HTML image control with the same path doesn't. I seem to be spending more time trying to figure out ASP.Net's shortcomings and...
14
by: J.S. | last post by:
In a Windows Form application, which is the better method to concatenate large blocks of code? 1. Reading the text from text files. 2. Adding the text to the VB file itself? Thanks! J.S. ...
122
by: seberino | last post by:
I'm interested in knowing which Python web framework is most like Ruby on Rails. I've heard of Subway and Django. Are there other Rails clones in Python land I don't know about? Which one...
12
by: DFS | last post by:
I need to scan various network folders and capture all the filenames and create dates. ======================================================= 1st effort used the typical drive scan cFile =...
7
by: jtbjurstrom | last post by:
Bear with me because we are new to WCF and have been going through documentation and samples trying to absorb as much as possible in a short amount of time. Any suggestions would be much...
5
by: daokfella | last post by:
I have a custom web.config section similar to the following: <CustomAuthSettings attr1="" attr2=""> <Locations RedirectUrl="Invalid.aspx"> <add Path="test.aspx" Roles="1,2,3" Permissions="4,5,6"...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.