Thread: Need some help...

  1. #16
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    scanf("%c", &rdata);

    rdata should be of type char, not char*

    and it will not store the name - just one char

    to store the name you need char array

    char filename[MAX_PATH]
    and use some suitable format, for example %s if name does not contains spaces

    same goes for printf
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  2. #17
    Registered User
    Join Date
    Mar 2008
    Posts
    30

    Help...

    Any reason why the data in my file cannot be displayed using this code? And is there a way to count how elements are there in a file?

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <math.h>
    #include <string.h>
    #define FILENAME "rdata.txt"
    
    int main()
    {
    	int readdata(double arrayx1[], double arrayy1[]);
    	int j, k, n; /* The number of entries read from file */
    	double arrayx[6], arrayy[6];
    	char *rdata;
    	FILE *data;
    	printf("File name: ");
    	scanf("%s", &rdata);
    	printf("n is 5\n", n);
    	data = fopen(FILENAME,"r");
    	for (j=0; j<5; j++)
    	{ 
    		fscanf(data, "%lf %lf", &arrayx[j], &arrayy[j]);
    	}
    	printf("n      X      Y\n");
    	
    	for (j=0; j<5; j++)
    	{
    			printf("%d  ",j);
    			printf("%.2lf %.2lf\n", arrayx[j], arrayy[j]);
    	}
    	return 0;
    }
    
    int readData(double arrayx1[], double arrayy1[])
    {
    	FILE *data;
        int n1 = 0; /* The number of entries read from file */
       
        /* Open input file.  */
        data = fopen(FILENAME,"r");
       
        /* Check if successful */
        if (data == NULL)
        {
            printf("Cannot open marks file for reading\n");
            exit(1);
        }
    
        /*  Read data .  */
        while (fscanf(data, "%d"))
            ++n1;
    		
            
        return n1;
    }
    The file contains:
    1.5 6.2
    1.7 6.5
    9.3 21.6
    5.9 14.7
    16.1 35.0

  3. #18
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    And when you do fscanf(data, "%d"), where do you expect the read-in number to go exactly? And also: how do you expect to read in a number like 1.5 using %d?

  4. #19
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    cannot be displayed - is not very detailed decription of the problem

    Your code does not have any error checking - check the return values of fopen and scanf

    also scanf("&#37;s", &rdata); is not healthy at all as was pointed several times already in the last days
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  5. #20
    Registered User
    Join Date
    Mar 2008
    Posts
    30

    About my latest post.....

    The problem is when I define FILENAME to a certain file name(e.g diag000.txt) the code can print the data in the file nicely, but what I want is to let the user be able to enter the file name of the file they want too use... Any suggestions?

    And also, I want the program to be able to calculate the number of data in the file for the first column only...

    Please help...

  6. #21
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by darkconvoy View Post
    The problem is when I define FILENAME to a certain file name(e.g diag000.txt) the code can print the data in the file nicely, but what I want is to let the user be able to enter the file name of the file they want too use... Any suggestions?
    Code:
    char buf[MAX_PATH];
    if(fgets(buf, sizeof buf, stdin))
    {
      /* remove \n and open file */
    }
    And also, I want the program to be able to calculate the number of data in the file for the first column only...
    What do you mean by "calculate the number of data"?
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  7. #22
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    So, as vart pointed out, don't screw up the reading in of the filename as badly as you did:
    (1) you need to have some memory available for what the user types in, such as char rdata[25]
    (2) you need to pass in a pointer to the memory, not a pointer to a pointer to the memory (rdata vs. &rdata)
    (3) there is no possible way to make %s be right; either use a number in the format specifier, such as %24s, or use fgets

    As for the other, you need to know either (a) how many numbers are in each line, or (b) whether the number you just read in was immediately preceded by a new-line.

  8. #23
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    As for the other, you need to know either (a) how many numbers are in each line, or (b) whether the number you just read in was immediately preceded by a new-line.
    or just use pair fgets/sscanf so you know exactly how many lines are sucessfully read from file, and parsed into numbers
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  9. #24
    Registered User
    Join Date
    Mar 2008
    Posts
    30

    Problems with my code...

    I don't understand what do you mean by using fgets.... I just want the program to determine how many rows of data are available in a file then use that number to calculate the mean of the data....

    And do you know what does "addMarx was not declared in this scope" as I am trying to plot the data in the file on a graph......

    Please include examples on what I should do to solve these problems....

    The data in my file is as follows:
    1.5 6.2
    1.7 6.5
    9.3 21.6
    5.9 14.7
    16.1 35.0

  10. #25
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    fgets is the "read from a file" command, which reads a line from a file.

    "addMarx was not declared in this scope" means that addMarx was not declared in this scope, that is, you are using a variable you haven't declared.

  11. #26
    Registered User
    Join Date
    Mar 2008
    Posts
    30

    About my problem..

    Can anyone give me a working code that can determine the number of elements in pairs in a file?

    an e.g of the file :
    1.5 6.2
    1.7 6.5
    9.3 21.6
    5.9 14.7
    16.1 35.0

  12. #27
    Registered User
    Join Date
    Dec 2007
    Posts
    214
    printf("Name of file: ");
    scanf("&#37;c", &rdata);
    This isn't going to work. Your file name isn't one character (%c).


    Edit : Man I type too slow, and don't read the full thread before posting.
    Last edited by DaveH; 04-28-2008 at 11:07 AM.

  13. #28
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Can anyone give me a working code that can determine the number of elements in pairs in a file?
    If you need to know number of lines in a file - use fgets to read a line
    and count number of successful calls

    If you need to know the number of numbers in each line - use sscanf and check the return value

    Next time asking question - show some code demonstrating your afforts
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  14. #29
    Registered User
    Join Date
    Mar 2008
    Posts
    30

    Help me

    Can anyone fix my code?
    My code stops working just before it starts calculating the variable a...
    Here is my code:
    Code:
    /*assign3_4201302.c
    * Student Name : Syed Rizal Alfam
    * Student ID : 4201302
    *This program will read a set of data from a file, calulate the correlation with the ok-line and
    *draw the graph of the ok-line and plot the set of data on the graph
    */
    #include <stdio.h>
    #include <stdlib.h>
    #include <math.h>
    #include <string.h>
    #include <koolplot.h>
    
    
    int main()
    {
    	/* Define variables */
    	int j, k, sl, yi, p, xy=5, n=p+xy,xp, xl, xu, sn; /* The number of entries read from file */
    	int readData(double arrayx[], double arrayy[], int j);
    	double a, b, cor, arrayx[50], arrayy[50], ssumy2, ssumny2, ssumnxy2, sumxy, sumx2;
    	double ssumx1, sMx, ssumy1, sMy, ssumx2, sa, ssumxy, ssumnxy, ssumnx2, sb, scor;
    	double getsumxy(double ssumx1, double sMx, double ssumy1, double sMy, int sn);
    	double getsumx2(double arrayx[], double sMx, double sMy, int sn);
    	double getb(double sMy, double sMx, double sa);
    	double getcor(double ssumxy, double ssumnxy, double ssumy2, double ssumx2, double ssumnx2, 
    			  double ssumny2, double ssumnxy2, int sn);
    	void printResults(double sa, double sb, double scor);
    	void graph(double arrayx[], double arrayy[]);
    	
    	
    	/* Read data from file */
    	xy = readData(arrayx, arrayy, j);
    	
    	/*Enter details of Ok line*/
    	printf("Enter the slope of ok line: ");
    	scanf("%d", &sl);
    	printf("Enter the y-intercept of the ok line: ");
    	scanf("%d", &yi);
    	printf("Enter lower bound of x value: ");
    	scanf("%d", &xl);
    	printf("Enter upper bound of x value: ");
    	scanf("%d", &xu);
    	printf("Enter the number of points to be generated: ");
    	scanf("%d", &p);
    	printf("Points from ok line %dx + %d:\n", sl, yi);
    	printf("X      Y\n");
    	for (j=xy; j<p+xy; j++)
    	{
    			xp=j-xy;
    			arrayy[j] = sl*xp + yi;
    			printf("%d   %.2lf\n", xp, arrayy[j]);
    	}
    	
    	/*Obtain value of a*/
    	sumxy = getsumxy(ssumx1, sMx, ssumy1, sMy, sn);
    	sumx2 = getsumx2(arrayx, sMx, sMy, sn);
    	a = sumxy / sumx2;
    	/*End of a*/
    	
    	/*Obtain value of b*/
    	b = getb(sMy, sMx, sa);
    	
    	/*Obtain value of cor*/
    	cor = getcor(ssumxy, ssumnxy, ssumy2, ssumx2, ssumnx2, ssumny2, ssumnxy2, sn);
    	
    	/*Print results*/
    	printResults(sa, sb, scor);
    	
    	/*Draw graph*/
    	graph(arrayx, arrayy);
    	
    	/*Return*/
    	return 0;
    }
    
    /* Function readData 
     * Opens file and read data into marks array.
     *
     * Parameter: arrayx and arrayy - array of doubles to store data from file
     *                  
     * Return:    number of entries read from file
     */
    int readData(double arrayx[], double arrayy[], int j)
    {
       	char rdata[25];
    	FILE *data;
    	printf("File name(must be typed with file type): ");
    	scanf("%s", &rdata);
        j=0; /* The number of entries read from file */
       
        /* Open input file.  */
        data = fopen(rdata,"r");
       
        /* Check if successful */
        if (data == NULL)
        {
            printf("Cannot open marks file for reading\n");
            exit(1);
        }
    
        /*  Read data .  */
        while (fscanf(data, "%.2lf %.2lf", &arrayx[j], &arrayy[j]) == 2)
            j++;
    		
            
        return j;
    }
    
    double getsumxy(double sumx1, double Mx, double sumy1, double My, int n)
    {
    	double a, arrayx[50], arrayy[50], sumxy; 
    	int j;
    
    	/*Determine mean of x*/
    	sumx1 = 0.00;
    	for(j = 0; j < n; j++)
    	{
    		sumx1 = sumx1 + arrayx[j];
    	}
    	Mx = sumx1 / n;
    	/*End mean of x*/
    
    	/*Determine mean of y*/
    	sumy1 = 0.00;
    	for(j = 0; j < n; j++)
    	{
    		sumy1 = sumy1 + arrayy[j];
    	}
    	My = sumy1/n;
    	/*End mean of y*/
    
    	/*Determine sumxy*/
    	sumxy = 0.00;
    	for(j = 0; j < n; j++)
    	{
    		sumxy = sumxy + (arrayx[j] - Mx)*(arrayy[j] - My);
    	}
    	/*End of sumxy*/
    	return sumxy;
    }
    
    
    double getsumx2(double arrayx[], double Mx, double My, int n)
    {
    	/*Determine sumx2*/
    	double sumx2 = 0.00;
    	int j;
    	for(j = 0; j < n; j++)
    	{
    		sumx2 = (sumx2 + ((arrayx[j] - Mx)*(arrayx[j] - Mx)));
    	}
    	/*End of sumx2*/
    	return sumx2;
    }
    
    
    double getb(double My, double Mx, double a)
    {
    	double b; 
    	/*Determine b:*/
    	b = 0.00;
    	b = (b + My) - (a * Mx);
    	/*End of b*/
    	
    	return b;
    }
    
    double getcor(double sumxy, double sumnxy, double sumy2, double sumx2, double sumnx2, 
    			  double sumny2, double sumnxy2, int n)
    {
    	double sumx1, Mx, sumy1, My, cor, arrayy[50]; 
    	double c, d;
    	int xy, p, j; 
    	n = xy+p;
    
    	/*Determine sumnxy*/
    	sumnxy = 0.00;
    	sumnxy = sumnxy + (sumxy/n);
    	/*End of sumnxy*/
    
    	/*Determine sumy2*/
    	sumy2 = 0.00;
    	for(j = 0; j < n; j++)
    	{
    		sumy2 = sumy2 + ((arrayy[j] - My)*(arrayy[j] - My));
    	}
    	/*End of sumy2*/
    
    	/*Determine sumnx2*/
    	sumnx2 = 0.00;
    	c = 0.00;
    	c = c + (sumx2/n);
    	sumnx2 = sumnx2 + sqrt(c);
    	/*End of sumnx2*/
    
    	/*Determine sumny2*/
    	sumny2 = 0.00;
    	d = 0.00;
    	d = d + (sumy2/n);
    	sumny2 = sumny2 + sqrt(d);
    	/*End of sumny2*/
    
    	/*Determine sumnxy2*/
    	sumnxy2 = 0.00;
    	sumnxy2 = sumnxy2 + (sumnx2 * sumny2);
    	/*End of sumnxy2*/
    
    	/*Determine cor*/
    	cor  = 0.00;
    	cor = cor + (sumnxy / sumnxy2);
    	/*End of cor*/
    	
    	return cor;
    }
    
    /* Function printResults 
     * Display the value of a, b, and cor
     * Determine the status of chip
     *
     * Parameter: geta           - the value of a
     * Parameter: getb           - the value of b
     * Parameter: cor  			 - the value of correlation
     * return   - void
     */
    void printResults(double a, double b, double cor)
    {
    	printf("Value of a is %.2lf\n", a);
    	printf("Value of b is %.2lf\n", b);
    	printf("Value of correlation is %.2lf\n", cor);
    	if (cor < 0.98)
    	{
    		printf("Possible chip failure\n");
    	}
    	else
    	{
    		printf("Chip is OK\n");
    	}
    
    }
    
    /*Function graph
     *Draws graph of ok line and 
     *plots the data from the file on the graph*/
    void graph(double arrayx[], double array[])
    {
    	plotdata x(xl, xu);
    	plotdata y = sl*x + yi;
    	for (j=0; j<xy; j++)
    	{
    		addMark(x, y, arrayx[j], arrayy[j]);
    	}
    	plot(x, y, BLACK, "SELF MONITORING: ok line: y = 2x + 3   Correlation:1 ->ok");
    
    }

  15. #30
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Try to fix warnings before continue your work - especially - about usage of not-initialized variables
    Code:
    -*- mode: compilation; default-directory: "~/test3/" -*-
    Compilation started at Tue Apr 29 01:40:35
    
    make -k 
    icc -o test3.o -c -g -Wall test3.c 
    test3.c(11): warning #991: //-style comments are nonstandard
      //#include <koolplot.h>
      ^
    
    test3.c(17): warning #592: variable "p" is used before its value is set
      	int j, k, sl, yi, p, xy=5, n=p+xy,xp, xl, xu, sn; /* The number of entries read from file */
      	                             ^
    
    test3.c(18): warning #1419: external declaration in primary source file
      	int readData(double arrayx[], double arrayy[], int j);
      	    ^
    
    test3.c(21): warning #1419: external declaration in primary source file
      	double getsumxy(double ssumx1, double sMx, double ssumy1, double sMy, int sn);
      	       ^
    
    test3.c(22): warning #1419: external declaration in primary source file
      	double getsumx2(double arrayx[], double sMx, double sMy, int sn);
      	       ^
    
    test3.c(23): warning #1419: external declaration in primary source file
      	double getb(double sMy, double sMx, double sa);
      	       ^
    
    test3.c(24): warning #1419: external declaration in primary source file
      	double getcor(double ssumxy, double ssumnxy, double ssumy2, double ssumx2, double ssumnx2, 
      	       ^
    
    test3.c(26): warning #1419: external declaration in primary source file
      	void printResults(double sa, double sb, double scor);
      	     ^
    
    test3.c(27): warning #1419: external declaration in primary source file
      	void graph(double arrayx[], double arrayy[]);
      	     ^
    
    test3.c(31): warning #592: variable "j" is used before its value is set
      	xy = readData(arrayx, arrayy, j);
      	                              ^
    
    test3.c(54): warning #592: variable "ssumx1" is used before its value is set
      	sumxy = getsumxy(ssumx1, sMx, ssumy1, sMy, sn);
      	                 ^
    
    test3.c(54): warning #592: variable "sMx" is used before its value is set
      	sumxy = getsumxy(ssumx1, sMx, ssumy1, sMy, sn);
      	                         ^
    
    test3.c(54): warning #592: variable "ssumy1" is used before its value is set
      	sumxy = getsumxy(ssumx1, sMx, ssumy1, sMy, sn);
      	                              ^
    
    test3.c(54): warning #592: variable "sMy" is used before its value is set
      	sumxy = getsumxy(ssumx1, sMx, ssumy1, sMy, sn);
      	                                      ^
    
    test3.c(54): warning #592: variable "sn" is used before its value is set
      	sumxy = getsumxy(ssumx1, sMx, ssumy1, sMy, sn);
      	                                           ^
    
    test3.c(60): warning #592: variable "sa" is used before its value is set
      	b = getb(sMy, sMx, sa);
      	                   ^
    
    test3.c(63): warning #592: variable "ssumxy" is used before its value is set
      	cor = getcor(ssumxy, ssumnxy, ssumy2, ssumx2, ssumnx2, ssumny2, ssumnxy2, sn);
      	             ^
    
    test3.c(63): warning #592: variable "ssumnxy" is used before its value is set
      	cor = getcor(ssumxy, ssumnxy, ssumy2, ssumx2, ssumnx2, ssumny2, ssumnxy2, sn);
      	                     ^
    
    test3.c(63): warning #592: variable "ssumy2" is used before its value is set
      	cor = getcor(ssumxy, ssumnxy, ssumy2, ssumx2, ssumnx2, ssumny2, ssumnxy2, sn);
      	                              ^
    
    test3.c(63): warning #592: variable "ssumx2" is used before its value is set
      	cor = getcor(ssumxy, ssumnxy, ssumy2, ssumx2, ssumnx2, ssumny2, ssumnxy2, sn);
      	                                      ^
    
    test3.c(63): warning #592: variable "ssumnx2" is used before its value is set
      	cor = getcor(ssumxy, ssumnxy, ssumy2, ssumx2, ssumnx2, ssumny2, ssumnxy2, sn);
      	                                              ^
    
    test3.c(63): warning #592: variable "ssumny2" is used before its value is set
      	cor = getcor(ssumxy, ssumnxy, ssumy2, ssumx2, ssumnx2, ssumny2, ssumnxy2, sn);
      	                                                       ^
    
    test3.c(63): warning #592: variable "ssumnxy2" is used before its value is set
      	cor = getcor(ssumxy, ssumnxy, ssumy2, ssumx2, ssumnx2, ssumny2, ssumnxy2, sn);
      	                                                                ^
    
    test3.c(66): warning #592: variable "sb" is used before its value is set
      	printResults(sa, sb, scor);
      	                 ^
    
    test3.c(66): warning #592: variable "scor" is used before its value is set
      	printResults(sa, sb, scor);
      	                     ^
    
    test3.c(17): warning #177: variable "k" was declared but never referenced
      	int j, k, sl, yi, p, xy=5, n=p+xy,xp, xl, xu, sn; /* The number of entries read from file */
      	       ^
    
    test3.c(17): warning #177: variable "n" was declared but never referenced
      	int j, k, sl, yi, p, xy=5, n=p+xy,xp, xl, xu, sn; /* The number of entries read from file */
      	                           ^
    
    test3.c(19): warning #593: variable "a" was set but never used
      	double a, b, cor, arrayx[50], arrayy[50], ssumy2, ssumny2, ssumnxy2, sumxy, sumx2;
      	       ^
    
    test3.c(19): warning #593: variable "b" was set but never used
      	double a, b, cor, arrayx[50], arrayy[50], ssumy2, ssumny2, ssumnxy2, sumxy, sumx2;
      	          ^
    
    test3.c(19): warning #593: variable "cor" was set but never used
      	double a, b, cor, arrayx[50], arrayy[50], ssumy2, ssumny2, ssumnxy2, sumxy, sumx2;
      	             ^
    
    test3.c(82): warning #1418: external function definition with no prior declaration
      int readData(double arrayx[], double arrayy[], int j)
          ^
    
    test3.c(87): warning #181: argument is incompatible with corresponding format string conversion
      	scanf("&#37;s", &rdata);
      	            ^
    
    test3.c(101): warning #269: invalid format string conversion
          while (fscanf(data, "%.2lf %.2lf", &arrayx[j], &arrayy[j]) == 2)
                                             ^
    
    test3.c(108): warning #1418: external function definition with no prior declaration
      double getsumxy(double sumx1, double Mx, double sumy1, double My, int n)
             ^
    
    test3.c(110): warning #177: variable "a" was declared but never referenced
      	double a, arrayx[50], arrayy[50], sumxy; 
      	       ^
    
    test3.c(142): warning #1418: external function definition with no prior declaration
      double getsumx2(double arrayx[], double Mx, double My, int n)
             ^
    
    test3.c(142): warning #869: parameter "My" was never referenced
      double getsumx2(double arrayx[], double Mx, double My, int n)
                                                         ^
    
    test3.c(156): warning #1418: external function definition with no prior declaration
      double getb(double My, double Mx, double a)
             ^
    
    test3.c(167): warning #1418: external function definition with no prior declaration
      double getcor(double sumxy, double sumnxy, double sumy2, double sumx2, double sumnx2, 
             ^
    
    test3.c(173): warning #592: variable "xy" is used before its value is set
      	n = xy+p;
      	    ^
    
    test3.c(173): warning #592: variable "p" is used before its value is set
      	n = xy+p;
      	       ^
    
    test3.c(170): warning #177: variable "sumx1" was declared but never referenced
      	double sumx1, Mx, sumy1, My, cor, arrayy[50]; 
      	       ^
    
    test3.c(170): warning #177: variable "Mx" was declared but never referenced
      	double sumx1, Mx, sumy1, My, cor, arrayy[50]; 
      	              ^
    
    test3.c(170): warning #177: variable "sumy1" was declared but never referenced
      	double sumx1, Mx, sumy1, My, cor, arrayy[50]; 
      	                  ^
    
    test3.c(224): warning #1418: external function definition with no prior declaration
      	scanf("%d", &xu);
      	    ^
    
    test3.c(243): warning #1418: external function definition with no prior declaration
      	b = getb(sMy, sMx, sa);
      	    ^
    
    test3.c(245): error: identifier "plotdata" is undefined
      	plotdata x(xl, xu);
      	^
    
    test3.c(245): warning #92: identifier-list parameters may only be used in a function definition
      	plotdata x(xl, xu);
      	         ^
    
    test3.c(245): warning #310: old-style parameter list (anachronism)
      	plotdata x(xl, xu);
      	         ^
    
    test3.c(245): warning #1419: external declaration in primary source file
      	plotdata x(xl, xu);
      	         ^
    
    test3.c(246): error: identifier "plotdata" is undefined
      	plotdata y = sl*x + yi;
      	^
    
    test3.c(246): error: identifier "sl" is undefined
      	plotdata y = sl*x + yi;
      	             ^
    
    test3.c(246): error: expression must have arithmetic type
      	plotdata y = sl*x + yi;
      	                ^
    
    test3.c(246): error: identifier "yi" is undefined
      	plotdata y = sl*x + yi;
      	                    ^
    
    test3.c(247): error: identifier "j" is undefined
      	for (j=0; j<xy; j++)
      	     ^
    
    test3.c(247): error: identifier "xy" is undefined
      	for (j=0; j<xy; j++)
      	            ^
    
    test3.c(249): warning #266: function "addMark" declared implicitly
      		addMark(x, y, arrayx[j], arrayy[j]);
      		^
    
    test3.c(249): error: identifier "arrayy" is undefined
      		addMark(x, y, arrayx[j], arrayy[j]);
      		                         ^
    
    test3.c(249): remark #981: operands are evaluated in unspecified order
      		addMark(x, y, arrayx[j], arrayy[j]);
      		^
    
    test3.c(251): warning #266: function "plot" declared implicitly
      	plot(x, y, BLACK, "SELF MONITORING: ok line: y = 2x + 3   Correlation:1 ->ok");
      	^
    
    test3.c(251): error: identifier "BLACK" is undefined
      	plot(x, y, BLACK, "SELF MONITORING: ok line: y = 2x + 3   Correlation:1 ->ok");
      	           ^
    
    test3.c(251): remark #981: operands are evaluated in unspecified order
      	plot(x, y, BLACK, "SELF MONITORING: ok line: y = 2x + 3   Correlation:1 ->ok");
      	^
    
    test3.c(243): warning #869: parameter "array" was never referenced
      	b = getb(sMy, sMx, sa);
      	                       ^
    
    compilation aborted for test3.c (code 2)
    make: *** [test3.o] Error 2
    make: Target `all' not remade because of errors.
    
    Compilation exited abnormally with code 2 at Tue Apr 29 01:40:35
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed