User Profile

Collapse

Profile Sidebar

Collapse
Shane Fitz
Shane Fitz
Last Activity: Dec 17 '10, 10:30 AM
Joined: Nov 30 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Shane Fitz
    started a topic Help with Eiffel program please

    Help with Eiffel program please

    I can't seem to get my program to setup the hashed dictionary correctly. It seems to keep the last entry in, and references every key to that entry.

    Code:
    dictsetup(h:HASHED_DICTIONARY [HASHED_SET[STRING], STRING]; fname:STRING) is
    		local
    			in_file: TEXT_FILE_READ;
    			t, t0: STRING
    		do
    			from
    				!!in_file.connect_to(fname)
    				!!set.make
    			until
    				in_file.end_of_input
    ...
    See more | Go to post

  • Shane Fitz
    started a topic Returning a Two-D Array?
    in C

    Returning a Two-D Array?

    I need help returning a 2-d array from a function. I set up the array with no problems, but I want to know how to return it from the function. I was looking at pointer-to-pointer options but I'm confused now.

    Code:
    char ** setup_mutations()
    {
    	char mutations[256][MAX_STRING]; 
    	char ** result;// = malloc(sizeof(char));
    	int i,j;
    	char c, current, string[MAX_STRING];
    	FILE * fp;
    ...
    See more | Go to post

  • [Warning]assignment makes integer from pointer without a cast

    The title is the warning I get when I try to run the following function

    Code:
    char * setup_mutations()
    {
    	char *result = malloc(sizeof(char));
    	int i;
    	char c, current, string[MAX_STRING];
    	FILE * fp;
    	
    	if((fp = fopen("mutations.txt","r"))==NULL){
    		printf("Mutations file not available\n");
    		exit(2);
    	}
    	
    	for(i=0; i<256; i++){
    ...
    See more | Go to post

  • Shane Fitz
    started a topic How to fix errors relating to pointers in C?
    in C

    How to fix errors relating to pointers in C?

    I am getting a warning and a common error in my code, and I need help understanding them.

    The warning is:[Warning] assignment makes pointer from integer without a cast

    Here is the code that i get the warning from:
    Code:
    line1 = biset_new(MAX_STRING); 
    	line2 = bitset_new(MAX_STRING);
    	bitset_un = bitset_new(MAX_STRING);
    	bitset_in = bitset_new(MAX_STRING);
    the left hand of...
    See more | Go to post
No activity results to display
Show More
Working...