Thanks Salem. It turns out that the assumption was only the problem. When I printed up to 20 digits after the decimal point, I could see the difference in the two numbers.
Type: Posts; User: ashesh
Thanks Salem. It turns out that the assumption was only the problem. When I printed up to 20 digits after the decimal point, I could see the difference in the two numbers.
Oops.. sorry abt that...was in a hurry when I posted that. Will take care next time and indent.
There were no warning given by the compiler. I executed the program on Fedora 1 gcc compiler and...
I have this small C program and I am unable to locate the mistake. Can someone help me locate it?
#include<stdio.h>
int main()
{
float a=0.0,b=0.0;
float a1=0.0;...
Finally could compile my program that call LAPACK subroutines.
To compile a program that calls LAPACK subroutines use "-llapacl" ie.,
g77 filename.f -llapack
If "BLAS" subroutines are also...
Hi Salem,
It was very urgent for me to know the answer and I couldn't think of a better place to post...
I read that I need to use g77 prog.f -ldxml,
but that wouldn't work...
Could u let...
I have Linear Algebra PACKage, (LAPACK) installed in my computer as I had opted for it during installationof Linux RH8.0. I need to use some of the routines in this package. These routines can be...
hi Wledge
yes, the program works when I use
using namepsace std
But I dont know why I am using it and what it does...
The program I wrote without namespace is working on one compiler but...
I have checked running the "hello!world" program on some other linux systsm. It worked fine.
So I think there seems to be some compiler problem... AndI think that is what the error is trying to...
use of #include <iostream> resulted in the following errors...
[ashesh@ecl5 learnc]$ c++ file1.cpp
file1.cpp: In function `int main()':
file1.cpp:6: `cout' undeclared (first use this function)...
I am new to both C++ as well as Linux.
The following program is to print "hello! world"
When I complie it saying
c++ file1.cpp
The follwoing errors occur... what could be the reason?...
main() {
int *x;
int r,c,i,j;
printf("\nEnter r and c ");
scanf("%d%d",&r,&c);
x = (int *)malloc(sizeof(int)*r*c);
for(i=0;i<r;i++)
for(j=0;j<c;j++)
scanf("%d",&x[i*r+j]);...
The size of the array is not constant and changes dynamically...
How I can pass a 2-dimensional array to a function.
The size of the array(m-by-n) is not the same each time I run the program...
Finally the program ran when I used "Ctrl+D" to represent "EOF"
Until now I was trying "Ctrl+Z" and "Ctrl+C"
Since EOF has a value "-1"; so this mean that "Ctrl+d" too has "-1" as its ASCII...
#include<stdio.h>
main() {
long nc;
nc = 0;
while(getchar()!=EOF)
++nc;
printf("\n nc = %ld \n",nc);
}
I have tried replacing EFO with '\0' too, but still does' nt work... I am using a C compiler provided by Linux RH8.0
#include<stdio.h>
main() {
char c;
int nc=1,nl=1;
while((c = getchar())!=EOF) {
if(c=='\n')
nl++;
else
nc++;
}
How do I print the values in the function after passing the array?
What is the statement for ??????? in the prog below?
#include <stdio.h>
void f2(int *aryp, int m, int n);
int main() {
...
How can I pass a 2D array to a func without specifing the size of the array!!!
Say, I my size of array is not fixed and hence I cannot specify array[][4] in the declaration...so what is the...
Hi,
the problem is that, i had posted my problem just before leaving the system.
I tried to install as per the information provided by "vVv". I mounted the cd and when I searched for the...
I tried doing that as a user as well as as root.
But neither gcc nor cc seem to be working.
ashesh
Well, I did ry gcc stuff...but it didnt work. I will try to reinstall the package \. Hope that helps me :(
Ashesh
Hi,
I have installed Linux Redhat 7.1 in my system and had opted for the installation of C compiler.
After the installation, when I login as a user/root, I a not able to complier a c program,...
In addition to math.h which other *.h files will need me to add switches like "-lm"
ashesh
Hi,
I am working in linux Redhat7.1, P3 system.
Whenever I compile a program which has a math function, I use the command:
cc filename.c -lm
I have to do this inspite of including math.h