Ohh-- it's a typo-- Yes, it should be
iptout=(long int)p;
Thank you!! The program now gave me correct result!!!
Type: Posts; User: ylzhang
Ohh-- it's a typo-- Yes, it should be
iptout=(long int)p;
Thank you!! The program now gave me correct result!!!
Yes, I wrote a test fortran77 code which calls mallocf, here are both codes and a makefile:
</bigscr/TEMP/temp_FC> cat testProgram.f
program test
integer MAX,BYTES_PER_INT
...
This is my question too! However, these C codes were specifically written (by a C expert I suppose) to allocate memory
for a collection of Fortran77 codes. And I have no idea of the intention of...
I type casted the malloc as well as included <stdlib.h>, but the code crashed in the same place:
(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) p iptout
iptout = 4295023136...
After I included stdlib.h in the module defining mallocf_(), and compile, I got:
cc -g -xarch=v9a mmsc.c -c
"mmsc.c", line 11: warning: improper pointer/integer combination: op "="
I'm...
No -- there are neither prototypes for malloc(), nor for mallocf_() in either the module which contains mallocf_() or in the module (mm2000.f) which calls mallocf_(). I actually considered this a...
Hi, I have a fortran77 program calling a C program to do memory allocation, and it compiled and ran fine under SUN's 32-bit environment. But when I compiled and ran under 64-bit, the code
has...
I have a piece of code which prints the values and addresses of a 2D array:
#include<stdio.h>
int main(void)
{
/* declare array[3][4] which is stored contigurously in memory */
int...
/*
#include<stdio.h>
struct msg{
char *p1;
char *p2;
char *p3;
}mymsg;
mymsg.p1="Teach yourself C in 21 days!";
Sorry... the tab key accidetally submits the last post....
#include<stdio.h>
main()
{
/* int c_A,c_a,c_return; */
Code reposted:
#include<stdio.h>
main()
{
/* int c_A,c_a,c_return; */
Just to test how to use code tags:
#include<stdio.h>
main()
{
int i;
int j;
i=0; j=1;
Is there any good reason to do address arithmatics instead of pointer arithmatics? Or is it always preferable to do pointer arithmatics?
What is the bit length a unique memory address occupies --...
I wrote a code to try to understand char/string/int:
#include<stdio.h>
main()
{
/* int c_A,c_a,c_return; */
char c_A, c_a, c_return; /* characters - each 1 byte */
Thanks for the reply. I just learned C last week following a tutorial - there is still much more to learn before I can properly understand these pointer problems. For example,
char *p;
char x;...
"You mean "why have Fortran code call into C code when Fortran has its own version of malloc and malloc64?" - good question."
Exactly! The code that I'm trying to make it work for a 64-bit Solar...
Yes, you're right -- the nwords is indeed misleading -- it's someone else's code which I don't want to change the variable names. In case I get to talk to the person who wrote it ...
I thought I...
Hi, I need to modify a set of codes (f77, f90 and c codes) for the 64-bit archtecture on Sun (SPARC v9) in a 64-bit Solaris operating environment. So, C data type may need conversion, for example,
...