#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2016
    Location
    S.E. Washington state
    Posts
    11
    Rep Power
    0

    security check for my program


    I couldn't find any way to PM a moderator and I wanted to ask if it was ok to post a program to have someone look at it to recommend changes that might be necessary to keep it from crashing.
    I have had no problems with it but I know what it needs - after all I wrote it. A second pair of eyes would be appreciated.

    I didn't want to violate any rules so I wanted to ask before I posted the listing and the question.

    Thanks,
    Paul
  2. #2
  3. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Posts
    5,796
    Rep Power
    508
    You can post programs here. I've done it for years without bad consequences. Unless you've signed a non-disclosure agreement or something.
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. Forgotten Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,093
    Rep Power
    9644
    That. Speaking as a moderator, posting code is generally fine provided that doing so does not breach any sort of license, NDA, or other restriction you may be under (which includes some employment contracts).

    How much code are we talking about? A few minutes to look over? A hundred or so lines? Going a lot further beyond that makes it more awkward for people to look at and understand during the free time they spend here.

    [edit] Hmm. 100 lines isn't as long as it sounds like. "A few hundred" is probably fine. There's a post limit of 64k (I think) so that might work better as an upper bound.
    Last edited by requinix; July 3rd, 2016 at 11:08 PM.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2016
    Location
    S.E. Washington state
    Posts
    11
    Rep Power
    0
    The entire program is only 420 lines, including comments. I don't get any warnings or errors but the file I/O code and the input routine both bother me a bit.
    I didn't know whether it was alright to post that much code - even if it is a small program. I don't expect anyone to go out of their way - I am relearning (I used to write using Turbo C for DOS) ANSI C for term programs in Linux.
    At 65 I find I am the one with a little time and don't expect others have as much as I do.

    I will await an answer before I list the program - it is copyrighted by me under the GNU - GPL #3 license so, open source all the way.
  8. #5
  9. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Posts
    5,796
    Rep Power
    508
    Go for it.
    [code]Code tags[/code] are essential for python code and Makefiles!
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2016
    Location
    S.E. Washington state
    Posts
    11
    Rep Power
    0
    Coding in C99, using the Geany, in Ubuntu 16.04 LTS
    I am most interested in preventing crashes due to input violations and how to make the file I/O more elegant but I will take any constructive criticism you have.
    I am 65 and forced to retire due to an injury that caused 100% disability - but I keep getting better and pushing myself in my recovery. I used to code for DOS using Turbo C and have had to unlearn a bunch of stuff.

    Code:
    // Exhaust Header Design Software Version 3.0
    // copyright (c) 2014 Paul Stephens
    // coded in C99 Dec. 1, 2014
    // credits:
    // Paul Stephens wrote the original code - 420 lines including comments.
    // This program is intended to calculate size and length for exhaust
    // headers for 6, 12, V8 and four cylinder four cycle engines with 3 or 4 
    // into 1 exhaust systems.
    // This program is free software; you can redistribute it and/or modify
    // it under the terms of the GNU General Public License as published by
    // the Free Software Foundation; either version 3 of the License, or
    // (at your option) any later version.
    // This program is distributed in the hope that it will be useful,
    // but WITHOUT ANY WARRANTY; without even the implied warranty of
    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    // GNU General Public License for more details.
    // You should have received a copy of the GNU General Public License
    // along with this program; if not, write to the Free Software
    // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    // MA 02110-1301, USA.
    
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <math.h>
    
    // declarations *******************************************************
    
    int clearscreen(void); // prints 100 'new line' characters
    int titlescreen(void); // puts the probram information as a header
    int pause(void); // used during coding - can be deleted now
    int input(char*, int); // entry routine for user input
    int newdata(void); // collects entry data and stores it in the struct
    int viewfile(void); // lets the user preview the calculated information
    int saveprnfile(void); // saves formatted output to text file - can be printed by any word processor
    int openfile(void); // opens saved data file
    int savefile(void); // saves data to a file
    
    // struct *************************************************************
    
    struct info
    {
    	float bore; // actual diameter of cylinder
    	float stroke; // the engine stroke
    	float exhaustopens; // the point BBDC at which the valve opens
    	float portlength; // distance from the exhaust valve to the flange
    	float compratio; // static compression ratio
    	float chambervol; // combustion chamber volume
    	float maxrpm; // rpm at which headers will be tuned
    	float exhausttemp; // average temp of exhaust gasses
    	float velsound; // 1976.5 fps speed of sound in the exhaust
    	float soundistance; // distance sound travels per degree of crank
    	float primarylength; // length of primary tubes
    	float primarydia; // diameter of primary tubes
    	float collectorlength; // optimal collector length
    	float collectordia; // optimal collector diameter
    	int cylcount; // number of cylinders in the engine
    } info;
    
    // global variables ***************************************************
    
    char lin[81];
    const float Pi = 3.14159;
    const float in2cc =.06102; // divide inches by to get cc's
    
    // main begins ********************************************************
    int main (void)
    {
    	int i = 0;
    	char ch;
    	do
    	{
    		clearscreen();
    		titlescreen();		
    		i = 0;
    		printf("\n\n\t\t\t1. Input new data\n");
    		printf("\n\t\t\t2. Save data to file\n");
    		printf("\n\t\t\t3. Print to file\n");
    		printf("\n\t\t\t4. View output\n");
    		printf("\n\t\t\t5. Open existing file\n");
    		printf("\n\t\t\t0. End program\n");
    		printf("\n\n\tEnter Letter or Number selection:\t");
    		ch = getchar();
    		getchar();
    		switch(ch)
    		{
    			case '1':
    			case 'I':
    			case 'i':
    			i = 1;
    			newdata();
    			break;
    			case '2':
    			case 'S':
    			case 's':
    			i = 2;
    			savefile();
    			break;
    			case '3':
    			case 'P':
    			case 'p':
    			i = 3;
    			saveprnfile();
    			break;
    			case '4':
    			case 'V':
    			case 'v':
    			i = 4;
    			viewfile();
    			break;
    			case '5':
    			case 'O': // 'O' as in Open
    			case 'o': // 'o' as in open
    			i = 5;
    			openfile();
    			break;
    			case '0':
    			case 'E':
    			case 'e':
    			i = 0;
    			break;
    		}
    	}
    	while(i != 0);
    	return(0);
    }
    // main ends **********************************************************
    
    // clearscreen begins *************************************************
    int clearscreen (void)
    {
    	int i = 0;
    	while(i < 100)
    	{
    		printf("\n");
    		i++;
    	} // screen is now cleared
    	return(0);
    }
    // clearscreen ends ***************************************************
    
    // input begins *******************************************************
    int input(char *titl, int length)
    {
    	char buf[length]; // set the length of input
    	buf[0] = '\0'; // initialize buf to an empty string
        char *p; // pointer to position in buf
    	lin[0] = '\0'; 
        printf ("Enter %s ",titl); // place prompt
        if (fgets(buf, length, stdin) != NULL) 
        { // test for and remove newline 
         if ((p = strchr(buf, '\n')) != NULL)
            {
    		   *p = '\0';
    		}
        }
        strcpy(lin, buf); // copy input to global 'lin'
        return 0;
    }
    // input ends *********************************************************
    
    // pause begins *******************************************************
    int pause(void)
    {
    	int i =0, x = 0;
    	for(i=0; i<= 32000; i++)
    	{
    		for(x=0; x<= 32000; x++);
    	}
    	return 0;
    }
    // pause ends *********************************************************
    
    // titlescreen begins *************************************************
    int titlescreen(void)
    {
    	printf("\tHeader Design Suite V.3.0 for 4, 6 and 8 cylinder 4 cycle engines\n\n");
    	printf("\t\t    by Services Unlimited tm\n\n");
    	printf("====================================================================\n");
    	printf("\t The information you need for proper computations is:\n\n");
    	printf("====================================================================\n");
    	printf("\n\t Cylinder bore and stroke in inches\n");
    	printf("\t The number of degrees before BDC that the exhaust valve opens\n");
    	printf("\t Exhaust port length in inches (from valve to flange)\n");
    	printf("\t Target RPM for which tuning is strongest\n");
    	printf("\t The measured or calculated compression ratio\n\n");
    	printf(" ====================================================================");
    	return(0);
    }
    // titlescreen ends ***************************************************
    
    // newdata begins *****************************************************
    int newdata(void)
    {
    	int length;
    	char titl[81];
    	float radius = 0;
    	float area = 0;
    	float volume = 0;
    	float ccvolume = 0;
    	clearscreen();
    	printf("\tEnter engine parameters\n\n\n");
    	strcpy(titl, "cylinder bore (inches)");
    	length = 7;
    	input(titl, length);
    	info.bore = atof(lin);
    	lin[0] = '\0';
    	strcpy(titl, "engine stroke (inches)");
    	length = 7;
    	input(titl, length);
    	info.stroke = atof(lin);
    	lin[0] = '\0';
    	strcpy(titl, "degrees BBDC that the exhaust valve opens");
    	length = 7;
    	input(titl, length);
    	info.exhaustopens = atof(lin);
    	lin[0] = '\0';
    	strcpy(titl, "exhaust port length");
    	length = 7;
    	input(titl, length);
    	info.portlength = atof(lin);
    	lin[0] = '\0';
    	strcpy(titl, "RPM at which to tune");
    	length = 7;
    	input(titl, length);
    	info.maxrpm = atof(lin);
    	lin[0] = '\0';
    	strcpy(titl, "compression ratio (?? to 1)");
    	length = 6;
    	input(titl, length);
    	info.compratio = atof(lin);
    	lin[0] = '\0';
    	printf("3 for 3 or 6 cylinders or 4 for 4 or 8 cylinders\n");
    	strcpy(titl, "number of cylinders (3 or 4)");
    	length = 4;
    	input(titl, length);
    	info.cylcount = atoi(lin);
    	lin[0] = '\0';
    	clearscreen();
    	radius = .5 * info.bore;
    	area = Pi * radius * radius;
    	volume = area * info.stroke;
    	info.chambervol = volume/info.compratio;
    	ccvolume = volume / in2cc;
    	info.primarylength = (750 * (180 + (info.exhaustopens))/info.maxrpm) - info.portlength;
    	info.primarydia = sqrtf((ccvolume / (25 * (info.primarylength + info.portlength)))) * 1.9;
    	info.collectorlength = (info.primarylength + info.portlength) / 2;
    	info.collectordia = sqrtf((volume) / (info.primarylength +info.portlength) * 25)/2;
    	if(info.cylcount == 3)
    		{
    		info.collectordia = sqrtf(((pow((info.collectordia/2),2)*Pi)*.75)/Pi)*2;
    		}
    	return(0);
    }
    // newdata ends *******************************************************
    
    // viewfile begins ****************************************************
    int viewfile(void)
    {
    	clearscreen();
    	printf("\n\n======= Header Design Suite Input =======\n");
    	printf("-------------- Version 3.0 --------------\n\n");
    	printf(" Bore __________________ %2.3f\n", info.bore);
    	printf(" Stroke ________________ %1.3f\n", info.stroke);
    	printf(" Comp __________________ %2.1f to 1\n", info.compratio);
    	printf(" RPM ___________________ %4.1f\n", info.maxrpm);
    	printf(" Exhaust valve opens ___ %3.1f before BDC\n\n", info.exhaustopens);
    	printf("==========================================\n\n");
    	printf("======= Header Design Suite Output =======\n");
    	if(info.cylcount == 4)
    	{
    		printf("\n\nHeader: Four single primary tubes into common collector\n\n");
    	}
    	else if(info.cylcount == 3)
    	{
    		printf("\n\nHeader: Three single primary tubes into common collector\n\n");
    	}
    	printf("---------------------------------------------------------------\n");
    	printf(" Primary tube inside diameter: _ %1.3f\n\n", info.primarydia);
    	printf(" Primary tube length: __________ %2.1f\n\n", info.primarylength);     
    	printf(" Collector diameter: ___________ %1.3f\n\n", info.collectordia);
    	printf(" Collector length ______________ %2.3f\n\n\n", info.collectorlength);
    	printf("\n\n\n\tPress ENTER to continue...");
    	getchar();
    	return (0);
    }
    // viewfile ends ******************************************************
    
    // saveprnfile begins *************************************************
    int saveprnfile(void)
    { // saves formatted output to a text file to be printed
    	FILE *fptr;
    	char *filename = "filename";
    	char filespec[79];
    	input(filename,79); // get path and file name
    	strcpy(filespec, lin); // copy path and file name to 'filespec'
    	lin[0] = '\0';
    	fptr = fopen(filespec, "a");
    	fprintf(fptr,"\t\t\t%s\n\n",filespec);
    	fprintf(fptr,"Header Design Suite\n");
    	fprintf(fptr,"Services Unlimited; Automotive Division\n");
    	fprintf(fptr,"Open Source Software\n\n\n");
    	fprintf(fptr,"\n\n======= Header Design Suite Input =======\n\n");
    	fprintf(fptr," Bore __________________ %2.3f\n", info.bore);
    	fprintf(fptr," Stroke ________________ %1.3f\n", info.stroke);
    	fprintf(fptr," Comp __________________ %2.1f to 1\n", info.compratio);
    	fprintf(fptr," RPM ___________________ %4.1f\n", info.maxrpm);
    	fprintf(fptr," Exhaust valve opens ___ %3.1f before BDC\n\n", info.exhaustopens);
    	fprintf(fptr,"==========================================\n\n");
    	fprintf(fptr,"======= Header Design Suite Output =======\n");
    	if(info.cylcount == 4)
    	{
    		fprintf(fptr,"\n\nHeader: Four single primary tubes into common collector\n\n");
    	}
    	else if(info.cylcount == 3)
    	{
    		fprintf(fptr,"\n\nHeader: Three single primary tubes into common collector\n\n");
    	}
    	fprintf(fptr,"-------------------------------------------------------\n\n");
    	fprintf(fptr," Primary tube inside diameter: _ %1.3f\n\n", info.primarydia);
    	fprintf(fptr," Primary tube length: __________ %2.1f\n\n", info.primarylength);     
    	fprintf(fptr," Collector diameter: ___________ %1.3f\n\n", info.collectordia);
    	fprintf(fptr," Collector length ______________ %2.3f\n\n\n", info.collectorlength);
    	fprintf(fptr,"\n\ncopyright (c) 2014 Paul Stephens, Services Unlimited; Automotive Div.");
    	fclose(fptr);
    	return(0);
    }
    // saveprnfile ends ***************************************************
    
    // openfile begins ****************************************************
    int openfile(void)
    {
    	FILE *fptr;
    	char ch;
    	char *filename ="filename";
    	char filespec[79];
    	do
    	{
    		ch = 'p';
    		input(filename,79);
    		strcpy(filespec, lin);
    		lin[0] = '\0';
    		clearscreen();
    		printf("\t\n\n Reading copy of %s from disk\n\n\n", filespec);
    		fptr = fopen(filespec, "r");
    		if ( fptr == NULL ) 
    		{
    			printf("file not found\n\n");
    			printf("Would you like to try again? Y or N\n\t\t");
    			ch = getchar();
    			getchar();
    			if(ch == 'N'||ch =='n')
    			{
    				break;
    			}
    			else if(ch == 'Y' || ch == 'y')
    			{
    				ch = 'Y';
    			}
    		}
    	}
    	while(ch == 'Y');
    	if(ch == 'N' || ch == 'n')
    	{
    		return(0);
    	}
    	else
    	{
    		fread(&info, sizeof(info), 1, fptr);
    		fclose(fptr);
    		return(0);
    	}
    }
    // openfile ends ******************************************************
    
    // savefile begins ****************************************************
    int savefile(void)
    {
    	FILE *fptr;
    	int x;
    	char ch;
    	char *filename = "filename";
    	char filespec[79];
    	do
    	{
    		x = 2;
    		input(filename, 79); // get the path and filename
    		strcpy(filespec, lin); // copy the entered path and filename
    		lin[0] = '\0';
    		clearscreen();
    		printf("\t\n\n checking copy of %s on disk\n\n\n", filespec);
    		fptr = fopen(filespec, "r");
    		if(fptr != NULL) // there is a file
    		{
    			printf("file already exists; Rename your file or Overwrite?");
    			printf("\n\nEnter R to rename or O to overwrite\t");
    			ch = getchar();
    			getchar(); // to strip out the newline character left
    			switch(ch)
    			{
    				case 'R':
    				case 'r':
    				x = 1;
    				fclose(fptr);
    				break;
    				case 'O': // 'O' as in Overwrite
    				case 'o': // 'o' as in overwrite
    				fclose(fptr);
    				x = 2;
    				break;
    			}
    		}
    	}
    	while(x == 1);
    	fptr = fopen(filespec, "w"); // open the write pointer
    	fwrite(&info, sizeof(info), 1, fptr); // write the file
    	fclose(fptr); // close the pointer because we are done
    	return 0;
    }
    // savefile ends ******************************************************
  12. #7
  13. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Posts
    5,796
    Rep Power
    508
    pause is as you know ridiculous. The delay duration depends on the speed of the processor. And the optimizing compiler which could entirely eliminate loops of no effect.
    You haven't invoked pause. If you need pause use

    #include <unistd.h>
    unsigned int sleep(unsigned int seconds);

    Or, for other timing ideas see programs of Metronome - Rosetta Code


    const float Pi = 3.14159; // M_PI is in math.h


    newdata has repeated sequences of 5 statements, which screams for a function. Actually, I didn't see a good reason to copy a string into titl. Nor can I think of a good reason to copy a value into length. And you can remove the global variable lin.
    Code:
    char*input(const char*titl, int length, char*lin) {
      char*p;
      lin[0] = 0;
      printf("Enter %s ",titl);
      if (fgets(buf, length, stdin) != NULL) // test for and remove newline 
        if ((p = strchr(buf, '\n')) != NULL)
          *p = 0;
      return lin;
    }
    
    float get_float(const char*title, int length) {
      // we now have the opportunity to verify
      char lin[81];
      return float(input(title, length, lin));
    }
    
    void newdata(void) {
      int length;
      char lin[81];
      float radius = 0;
      float area = 0;
      float volume = 0;
      float ccvolume = 0;
      clearscreen();
    
      printf("\tEnter engine parameters\n\n\n");
    
      info.bore = get_float("cylinder bore (inches)", 7);
      info.stroke = get_float("engine stroke (inches)", 7);
      info.exhaustopens = get_float("degrees BBDC that the exhaust valve opens", 7);
      info.portlength = get_float("exhaust port length", 7);
      info.maxrpm = get_float("RPM at which to tune", 7);
      info.compratio = get_float("compression ratio (?? to 1)", 6);
    
      puts("3 for 3 or 6 cylinders or 4 for 4 or 8 cylinders");
      info.cylcount = get_float("number of cylinders (3 or 4)", 4);
    
      clearscreen();
      radius = .5 * info.bore;
      area = M_PI * radius * radius;
      volume = area * info.stroke;
      info.chambervol = volume/info.compratio;
      ccvolume = volume / in2cc;
      info.primarylength = (750 * (180 + (info.exhaustopens))/info.maxrpm) - info.portlength;
      info.primarydia = sqrtf((ccvolume / (25 * (info.primarylength + info.portlength)))) * 1.9;
      info.collectorlength = (info.primarylength + info.portlength) / 2;
      info.collectordia = sqrtf((volume) / (info.primarylength +info.portlength) * 25)/2;
      if(3 == info.cylcount)
        info.collectordia = sqrtf(((pow((info.collectordia/2),2)*M_PI)*.75)/M_PI)*2;
    }


    For the functions having ignored return value should be void.



    titlescreen is ugly. I don't know any terrific solutions, however current versions of c concatenate strings that have only intervening white space. Hence you can write
    Code:
    void titlescreen(void) {
      printf("\tHeader Design Suite V.3.0 for 4, 6 and 8 cylinder 4 cycle engines\n\n"
    	 "\t\t    by Services Unlimited tm\n\n"
    	 "====================================================================\n"
    	 "\t The information you need for proper computations is:\n\n"
    	 "====================================================================\n"
    	 "\n\t Cylinder bore and stroke in inches\n"
    	 "\t The number of degrees before BDC that the exhaust valve opens\n"
    	 "\t Exhaust port length in inches (from valve to flange)\n"
    	 "\t Target RPM for which tuning is strongest\n"
    	 "\t The measured or calculated compression ratio\n\n"
    	 " ====================================================================");
    }

    viewfile and saveprnfile are so similar that you should consider having just one function that takes a FILE* argument to which it writes.
    In one case you can open a file, in another case use stdout .


    Sometimes you check whether a file exists before clobbering it. Sometimes not. Use a single function thus you'd have a single part of the program to change. The stat function is probably the usual way to determine if a file exists, although open for read access is easier than reading through the stat man page.


    The files seem to save and resume correctly. The menus don't work very well, bad entries lead to unexpected terminations.



    Summary, you've worked well with the c you remembered. Try to avoid duplicate code because it's easier to maintain, easier to read. Keep practicing.
    [code]Code tags[/code] are essential for python code and Makefiles!
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2016
    Location
    S.E. Washington state
    Posts
    11
    Rep Power
    0
    Yes I know that pause is a freak show. It was installed so I could trouble-shoot as I coded. I need to remove it now as I don't use it in the execution of the program.
    I also avoid anything not in the C99 standard for better portability. Some of my software I port to DOS and expect others to be able to port it to other OS's.
    M_PI carries with it a lot of precision that is not needed here. I decided I would use the less precise value. (that is a hold-over from my days of BASIC programming with very limited memory. I have stopped putting multiple instructions on a single line)
    "newdata" calls the "input" function and uses "titl" and "length" in the process. Since those parameters change with each input they must be specified. "titl" is the prompt for "input" and length is the length of the input from the user plus two spaces for the null character or end of file marker.
    I can see that I need to test for a proper answer to the query and I can add that so that random answers are not accepted.
    I am using the global "lin" to transfer both strings and numbers from functions to the calling function where the proper format is given to it and then "lin" is cleared in preparation for its next call. I don't know of a good way to transfer strings from one function to another. If you could tell me of ways to do this simply I can work on that and stop using a global to do that.
    I am just getting used to "int function_name(void)" and you tell me that I can go back to "void" if the return value is ignored. So, if I don't use the return value I can use void?
    I will incorporate the single print statement for a number of lines in the titlescreen. That makes it look a lot better. I wasn't aware that I could do that.
    The "stat" call is not part of the C 99 standard. I am trying not to use environment specific calls or POSIX calls in my software. I will look into changing the file check part into a function.
    There are times that I want a file added to a file with the same name (appended) but I can handle that within the function.
    The view and save files are very similar and their output is identical. I will look at combining them. I will need to use a variable or marker of some kind to show whether the output goes to the screen or a text file but that should be easy and I can use it in future programs as well.
    I agree that the menus need work. I need to know how I can keep a random entry from crashing... is there an elegant way to catch a wrong input and, after notifying the user, to go back to the menu?

    Thank you for not only your help but also the kind words. It is difficult for me at my age to learn new things but I feel that if I keep at it and keep trying to learn it will catch and stay with me.
    A couple of quick questions about system calls and POSIX; are they used a lot by C coders today and how "portable" are they? The reason I ask is that it could take my programs from "terminal use" and give them a GUI interface so more people would use them.

    Again thank you for adding your knowledge and taking the time to review this work.
    Paul
  16. #9
  17. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Posts
    5,796
    Rep Power
    508
    get_float (post 7, up 2 posts) calls input

    "Since those parameters change with each input they must be specified" Oh! The variable names do not matter. We have
    int input(char *titl, int length);
    When you call
    input("a pointer to char", AN_INTEGER);
    Within the function c assigns the pointer of "a pointer to char" to titl, and AN_INTEGER to length. It transfers this information via the stack independent of the names of the sources.

    Comments on this post

    • Will-O-The-Wisp agrees : Thank you!
    [code]Code tags[/code] are essential for python code and Makefiles!
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2016
    Location
    S.E. Washington state
    Posts
    11
    Rep Power
    0
    I was just going over the post you left me, the parts that you wrote to fix my mistakes were mistakenly overlooked as quotes of my code. I was just working on writing a test file routine and saw that you had given me the answers before my questions were asked.
    I am so sorry for not reading it completely before I copied it to work with later. You did a lot of work for me and I hadn't even noticed it. (shame emoticon)
    I am really ashamed of myself, please forgive me.
    You did even more than I had realized - I have never had someone write code in answer to a question before.
    I don't know how I can repay your kindness but, if nothing else, I will pay it forward.
    Thank you from the bottom of my heart!
    May your life be as wonderful as you can imagine!
    Thank you!
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2016
    Location
    S.E. Washington state
    Posts
    11
    Rep Power
    0
    I can't even give you reps yet because I am too new. Somebody needs to do it for me. I don't know what the maximum is but you deserve it.

IMN logo majestic logo threadwatch logo seochat tools logo