Article View: comp.os.os2.programmer
Article #1221C Set/2 Question in malloc
From: Uma Arunkumar
Date: Fri, 28 Aug 1992 15:48
Date: Fri, 28 Aug 1992 15:48
56 lines
1720 bytes
1720 bytes
****************** C Set/2 QUESTION ************************
I am trying to compile a small program (to solve a problem in a huge program)
in C Set/2 version 1.00.
This program was taken from the C Set/2 Program Example given for malloc
using KWIKINF.
***************************************************************
The program is given below:
#include <stdio.h>
#include<malloc.h>
main()
{
char str[50];
long *array;
int i;
for (i=0; i<50; i++)
str[i]='m';
if (( array= malloc(50 * sizeof(long)))!= NULL)
for (i=0; i<50; i++)
*array++=1;
}
*********************************************************
When I compile giving the command
icc /c /w3 /o+ sample.c
I get the following error messages:
SAMPLE.C(12:15) : error EDC0117: The operation between these types is not valid.
SAMPLE.C(12:10) : informational EDC0140: Operand has type pointer to signed long integer .
SAMPLE.C(12:17) : informational EDC0140: Operand has type signed integer .
This program compiles without any error in C compiler in Sun.
What is wrong in the above code?
I WOULD HIGHLY APPRECIATE SOME HELP.
Thanks in advance.
My Email address is uma@natinst.com.
uma.
Technical Details
Message-ID:
<1992Aug28.154836.12867@natinst.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!swrinde!news.dell.com!natinst.com!umaShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!swrinde!news.dell.com!natinst.com!uma From: uma@natinst.com (Uma Arunkumar) Newsgroups: comp.os.os2.programmer,comp.os.os2.apps,comp.os.os2.misc Subject: C Set/2 Question in malloc Message-ID: <1992Aug28.154836.12867@natinst.com> Date: 28 Aug 92 15:48:36 GMT Sender: news@natinst.com Organization: National Instruments, Austin, TX Lines: 56 Nntp-Posting-Host: falcon.natinst.com