14 Replies - 1993 Views - Last Post: 23 July 2011 - 12:57 PM Rate Topic: -----

#1 kaiser0792  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 62
  • Joined: 15-December 10

Multi-Dimensional Array Function Arguments

Posted 22 July 2011 - 05:19 PM

I am trying to compile a small amount of code that I am building into a larger project. I've really not worked much with multi-dimensional arrays (2-Dimensional in this case) and I having trouble trying to get my code to compile. I've tried various permutations, and my current one has reduced my error, seemingly, to one that I cannot find. The error message that I am receiving is "In function 'int(main)':
expected primary-expression before ']'token"

The error is flagging my function call to the TableHeadings() in Main().
I would appreciate any insight, its hanging me up and I need to finish this project by end of weekend. Thanks!

 #include <iostream>
#include <fstream>
#include <string>

using namespace std;

const int MAX_SIZE = 12;


// TableHeadings() -- Creates row and column headings for dynamic programming
//                    table.
void TableHeadings(int dynArr[][12], int hdrArr[]);


enum TableHeaders
{
    A, B, C, D, E, F, G, H, I, J, K, L
};

int main()
{
    int rows = MAX_SIZE;
    int columns = MAX_SIZE;
    int headerArray[] = {A, B, C, D, E, F, G, H, I, J, K, L};
    int numSearched[] = {17, 123, 47, 79, 160, 33, 45, 98, 20, 243, 110, 106};
    int dynamicProgArray[rows][columns];    
    
    ofstream outFile;
    outFile.open("smk0009.txt");
    
    TableHeadings(dynamicProgArray[rows][columns], headerArray[]);
    
    return 0;
}

// TableHeadings()
void TableHeadings(int dynArr[][12], int hdrArr[])
{
   int i, j;
        
   while (i = 0)  
   {
       for (int j = 0; j < MAX_SIZE; j++)
       {
           dynArr[i][j] = hdrArr[j - 1];
       }
   }
   while (j = 0)
   {
       for (int i = 0; i < MAX_SIZE; i++)  
       {
           dynArr[i][j] = hdrArr[i - 1];
       }
    }    
}




Is This A Good Question/Topic? 0
  • +

Replies To: Multi-Dimensional Array Function Arguments

#2 sk1v3r  Icon User is offline

  • D.I.C Addict

Reputation: 231
  • View blog
  • Posts: 668
  • Joined: 06-December 10

Re: Multi-Dimensional Array Function Arguments

Posted 22 July 2011 - 05:31 PM

When passing an array you needn't use the square brackets, just the name of the array. This is true for both arguments, as the first is out of bounds.
Was This Post Helpful? 0
  • +
  • -

#3 jimblumberg  Icon User is online

  • member icon


Reputation: 4133
  • View blog
  • Posts: 12,865
  • Joined: 25-December 09

Re: Multi-Dimensional Array Function Arguments

Posted 22 July 2011 - 05:40 PM

Your function prototype and function call do not match.
void TableHeadings(int dynArr[][12], int hdrArr[]); /// Prototype
     TableHeadings(dynamicProgArray[rows][columns], headerArray[]); // function call.



In your function call you are sending a single integer and a malformed integer array. The second parameter is malformed because you can not call a function with an empty index [], it must either have a size to pass a single integer or be missing to pass the address of the array. In your case there should be no [] since you want to pass an array. Remember the array variable name without the brackets is the address of the array.

The problem with your first parameter in your function call is passing a single element and you really want to send the address.

Also int dynamicProgArray[rows][columns]; should also produce an error. In C++ you must define your array sizes with constants. the variables rows and columns are not constant. You have constant named ARRAY_SIZE that should be used when declaring your arrays.

For future posts when you have compile errors, post the code along with the entire error message exactly as it appears in your development environment.


Also note that by using rows and columns as dynamicProgArray[rows][columns] since rows and columns is the size you defined for your array you are accessing the array out of bounds. In C/C++ arrays start a 0 and stop at size - 1.

Jim

This post has been edited by jimblumberg: 22 July 2011 - 05:41 PM

Was This Post Helpful? 0
  • +
  • -

#4 kaiser0792  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 62
  • Joined: 15-December 10

Re: Multi-Dimensional Array Function Arguments

Posted 22 July 2011 - 05:51 PM

I'm still confused. Can you be more specific about how to fix it. I've tried taking out brackets and I get several more errors. I did initialize the 2-D array with variables that hold constant value that I initialized prior to main(). I appreciate your comments, but I still am unsure how to fix it.
Was This Post Helpful? 0
  • +
  • -

#5 jimblumberg  Icon User is online

  • member icon


Reputation: 4133
  • View blog
  • Posts: 12,865
  • Joined: 25-December 09

Re: Multi-Dimensional Array Function Arguments

Posted 22 July 2011 - 06:10 PM

Post the modified code along with the complete error message.

Jim
Was This Post Helpful? 0
  • +
  • -

#6 kaiser0792  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 62
  • Joined: 15-December 10

Re: Multi-Dimensional Array Function Arguments

Posted 22 July 2011 - 07:44 PM

I've tinkered with the code some since your last reply, now I have more error codes. They are as follows:


C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp: In function `int main()':
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp:47: error: invalid conversion from `int*' to `int'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp:47: error: initializing argument 1 of `void TableHeadings(int, int)'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp:47: error: invalid conversion from `int*' to `int'

C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp:47: error: initializing argument 2 of `void TableHeadings(int, int)'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp: In function `void TableHeadings(int (*)[12], int)':

C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp:61: error: invalid types `int[int]' for array subscript
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp:70: error: invalid types `int[int]' for array subscript

Execution terminated





#include <iostream>
#include <fstream>
#include <string>

using namespace std;

const int MAX_SIZE = 12;


// TableHeadings() -- Creates row and column headings for dynamic programming
//                    table.
void TableHeadings(int dynArr, int hdrArr);


enum TableHeaders
{
    A, B, C, D, E, F, G, H, I, J, K, L
};

int main()
{
    int rows = MAX_SIZE;
    int columns = MAX_SIZE;
    int headerArray[] = {A, B, C, D, E, F, G, H, I, J, K, L};
    int numSearched[] = {17, 123, 47, 79, 160, 33, 45, 98, 20, 243, 110, 106};
    int dynamicProgArray[rows][columns];    
    
    ofstream outFile;
    outFile.open("smk0009.txt");
    
    TableHeadings(dynamicProgArray[L], headerArray);
    
    return 0;
}

// TableHeadings()
void TableHeadings(int dynArr[][12], int hdrArr)
{
   int i = 0, j = 0;
        
   while (i = 0)  
   {
       for (int j = 0; j < MAX_SIZE; j++)
       {
           dynArr[i][j] = hdrArr[j];
       }
       i++;
   }
   
   while (j = 0)
   {
       for (int i = 0; i < MAX_SIZE; i++)  
       {
           dynArr[i][j] = hdrArr[i];
       }
       j++;
    }    
}
 


Was This Post Helpful? 0
  • +
  • -

#7 kaiser0792  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 62
  • Joined: 15-December 10

Re: Multi-Dimensional Array Function Arguments

Posted 22 July 2011 - 08:02 PM

I have since stripped the code down to try and find the problem. I get 1 error message as follows:


Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp" -o "C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.exe" -g3 -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Dev-Cpp\include\c++\3.4.2" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib" -g3
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp: In function `int main()':
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:25: error: expected primary-expression before "outFile"

Execution terminated



The stripped down code follows:

#include <iostream>
#include <fstream>

using namespace std;

void TableHeadings(ofstream& outFile, int dynArr[12], int hdrArr[]);

const int MAX_SIZE = 12;

enum TableHeaders
{
     A, B, C, D, E, F, G, H, I, J, K, L
};

int main()
{
    int rows = MAX_SIZE;
    int columns = MAX_SIZE;
    int headerArray[] = {A, B, C, D, E, F, G, H, I, J, K, L};
    int dynamicProgArray[rows][columns];
    
    ofstream outFile;
    outFile.open("smk0009.txt");
    
    TableHeadings(ofstream outFile, dynamicProgArray[columns], headerArray);
    return 0;
}

void TableHeadings(ofstream& outFile, int dynArr[12], int hdrArr[])
{
   outFile << "Test";   
}


Was This Post Helpful? 0
  • +
  • -

#8 jimblumberg  Icon User is online

  • member icon


Reputation: 4133
  • View blog
  • Posts: 12,865
  • Joined: 25-December 09

Re: Multi-Dimensional Array Function Arguments

Posted 22 July 2011 - 08:03 PM

First your error messages do not match the posted code.

Quote

C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp:70: error: invalid types `int[int]' for array subscript


The highlighted number is the line number where the compiler is detecting the error, there is no line number 70 in your posted code.

Please explain the following code:
 TableHeadings(dynamicProgArray[L], headerArray);


What are you trying to do with the index L?

Jim
Was This Post Helpful? 0
  • +
  • -

#9 jimblumberg  Icon User is online

  • member icon


Reputation: 4133
  • View blog
  • Posts: 12,865
  • Joined: 25-December 09

Re: Multi-Dimensional Array Function Arguments

Posted 22 July 2011 - 08:15 PM

In the following snippet you are defining your array with non-constant variables. In C++ programs you must use const variables, you have the const MAX_SIZE, use that instead of rows, columns.

int dynamicProgArray[rows][columns];


In the following function call:
TableHeadings(ofstream outFile, dynamicProgArray[columns], headerArray);

You have defined your function as:
void TableHeadings(int dynArr[][12], int hdrArr)
.
And your prototype is:
void TableHeadings(ofstream& outFile, int dynArr[12], int hdrArr[]);


The function prototype, function implementation, and function call must all agree on the number and type of arguments. Do all three of these match?

Also your function call has the type (ofstream) for the first parameter, that is not needed. You should review how to pass variables into functions. See this link: C++ Tutorial, click on the Functions I and Functions II links.


Jim

This post has been edited by jimblumberg: 22 July 2011 - 08:19 PM

Was This Post Helpful? 0
  • +
  • -

#10 kaiser0792  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 62
  • Joined: 15-December 10

Re: Multi-Dimensional Array Function Arguments

Posted 22 July 2011 - 08:34 PM

I'm sorry, I don't know how the "L" got there. I understand now that I should use constants rather than variables for array dimensions. As far as my arguments not matching in prototype, function definition and function call, that is where the confusion is coming in. In my C++ textbook, it says not to use the first [] dimension in the function, but I have tried it eliminating it from declaration, definition and prototype and I keep getting a host of errors. As far as the line numbers not matching, sorry about that, I have some comments at beginning of program that messed up line number translations. Let me try once more to send stripped down version to see if you can look at error messages and help me through troubleshooting this code. I'm not sure at this point how to implement the 2-D array in declaration, definition or function call:

Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp" -o "C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.exe" -g3 -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Dev-Cpp\include\c++\3.4.2" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib" -g3
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp: In function `int main()':
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp:47: error: invalid conversion from `int*' to `int'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp:47: error: initializing argument 1 of `void TableHeadings(int, int)'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp:47: error: invalid conversion from `int*' to `int'

C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp:47: error: initializing argument 2 of `void TableHeadings(int, int)'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp: In function `void TableHeadings(int (*)[12], int)':

C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp:61: error: invalid types `int[int]' for array subscript
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\OBST.cpp:70: error: invalid types `int[int]' for array subscript

Execution terminated


//************************************************************************
//  Program: Optimal Binary Search Tree -- Project #2 (CS-317)
//  Description:  This program generates an optimal binary search tree 
//                for a given set of ordered keys with the number of
//                times each key is searched.  The program must logically
//                generate and output the optimal binary search tree from 
//                a dynamic programming table, i.e., the output cannot be 
//                simply be 'hard coded.'  The dynamic programming table 
//                will be output in tabular form and the binary tree will
//                be output similar to the folder view in Windows 
//                Explorer, i.e., in a file/directory structure.
//  Author:  Steven Kaiser
//  Date: 07/23/2011
//************************************************************************


#include <iostream>
#include <fstream>
#include <string>

using namespace std;

const int MAX_SIZE = 12;


// TableHeadings() -- Creates row and column headings for dynamic programming
//                    table.
void TableHeadings(int dynArr, int hdrArr);


enum TableHeaders
{
    A, B, C, D, E, F, G, H, I, J, K, L
};

int main()
{
    int rows = MAX_SIZE;
    int columns = MAX_SIZE;
    int headerArray[] = {A, B, C, D, E, F, G, H, I, J, K, L};
    int numSearched[] = {17, 123, 47, 79, 160, 33, 45, 98, 20, 243, 110, 106};
    int dynamicProgArray[rows][columns];    
    
    ofstream outFile;
    outFile.open("smk0009.txt");
    
    TableHeadings(dynamicProgArray[12], headerArray);
    
    return 0;
}

// TableHeadings()
void TableHeadings(int dynArr[][12], int hdrArr)
{
   int i = 0, j = 0;
        
   while (i = 0)  
   {
       for (int j = 0; j < MAX_SIZE; j++)
       {
           dynArr[i][j] = hdrArr[j];
       }
       i++;
   }
   
   while (j = 0)
   {
       for (int i = 0; i < MAX_SIZE; i++)  
       {
           dynArr[i][j] = hdrArr[i];
       }
       j++;
    }    
}
 


Was This Post Helpful? 0
  • +
  • -

#11 jimblumberg  Icon User is online

  • member icon


Reputation: 4133
  • View blog
  • Posts: 12,865
  • Joined: 25-December 09

Re: Multi-Dimensional Array Function Arguments

Posted 22 July 2011 - 08:56 PM

Okay since you are having problems with passing arrays lets concentrate on only passing arrays to a function:

#include <iostream>

using namespace std;

const int MAX_SIZE = 12;

// This is the function prototype.
void someFunction(int array1d[], int array2d[][MAX_SIZE]);

int main()
{
   int Single_array[MAX_SIZE];
   int Double_array[MAX_SIZE][MAX_SIZE];
   
   // This is the function call...
   someFunction(Single_array, Double_array);
   
   
   cout << "PRINT OUT SINGLE ARRAY\n";
   for(int i = 0; i < MAX_SIZE; ++i)
   {
      cout << Single_array[i] << " ";
   }
   cout << endl;
   cout << "PRINT OUT DOUBLE ARRAY\n";
   for(int i = 0; i < MAX_SIZE; ++i)
   {
      cout << "PRINT OUT ROW " << i+1 << endl;
      for(int j = 0; j < MAX_SIZE; ++j)
      {
         cout << Double_array[i][j] << " ";
      }
      cout << endl;
   }
}

// This the function implementation.
void someFunction(int array1d[], int array2d[][MAX_SIZE])
{
   int val2d = 0;
   int val1d = 0;
   for(int i = 0; i < MAX_SIZE; ++i)
   {
      for(int j = 0; j < MAX_SIZE; ++j)
      {
         array2d[i][j] = val2d;
         val2d++;
      }
      array1d[i] = val1d;
      val1d++;
   }
}



If you have any questions on the above code, ask.

Jim
Was This Post Helpful? 1
  • +
  • -

#12 kaiser0792  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 62
  • Joined: 15-December 10

Re: Multi-Dimensional Array Function Arguments

Posted 22 July 2011 - 09:08 PM

Jim, thank you very much!! I'm going to digest your code and if I have any more questions I will let you know. You have been a great help. I'm not just here to get answers, but to learn. Thanks for your patience and your time.
Was This Post Helpful? 0
  • +
  • -

#13 kaiser0792  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 62
  • Joined: 15-December 10

Re: Multi-Dimensional Array Function Arguments

Posted 22 July 2011 - 09:52 PM

Jim,
If you are still there, could you tell me what is wrong with my code here?

Error Messages:

Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp" -o "C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.exe" -g3 -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Dev-Cpp\include\c++\3.4.2" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib" -g3
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp: In function `int main()':
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'

C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'

C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'

C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'

C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'

C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'

C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'

C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'

C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'

C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'

C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'
C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'

Execution terminated



#include <iostream>
#include <fstream>
#include <string>

using namespace std;

//void TableHeadings(ofstream& outFile, int dynArr[12], int hdrArr[]);

const int MAX_SIZE = 13;

//char TableHeaders {0, A, B, C, D, E, F, G, H, I, J, K, L};

int main()
{
    int i = 0;
    int j = 0;
    
    char dynamicProgArray[MAX_SIZE][MAX_SIZE] =
    {
        {"X", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"},
        {"A", "", "", "", "", "", "", "", "", "", "", "", ""}, 
        {"B", "", "", "", "", "", "", "", "", "", "", "", ""},
        {"C", "", "", "", "", "", "", "", "", "", "", "", ""}, 
        {"D", "", "", "", "", "", "", "", "", "", "", "", ""},
        {"E", "", "", "", "", "", "", "", "", "", "", "", ""},
        {"F", "", "", "", "", "", "", "", "", "", "", "", ""},
        {"G", "", "", "", "", "", "", "", "", "", "", "", ""},
        {"H", "", "", "", "", "", "", "", "", "", "", "", ""},
        {"I", "", "", "", "", "", "", "", "", "", "", "", ""},
        {"J", "", "", "", "", "", "", "", "", "", "", "", ""},
        {"K", "", "", "", "", "", "", "", "", "", "", "", ""},
        {"L", "", "", "", "", "", "", "", "", "", "", "", ""} 
    };
    return 0;
} 



Was This Post Helpful? 0
  • +
  • -

#14 jimblumberg  Icon User is online

  • member icon


Reputation: 4133
  • View blog
  • Posts: 12,865
  • Joined: 25-December 09

Re: Multi-Dimensional Array Function Arguments

Posted 22 July 2011 - 10:11 PM

Lets take a look at one of these errors, (all the errors appear to be the same line):

Quote

C:\Users\Steve\Desktop\CS_317_Summer\Projects\Project_2\TestCodeOBST.cpp:33: error: invalid conversion from `const char*' to `char'


Line 33 is the last line of your array declaration. The first problem is that in C/C++ a char constant is denoted by the single quotation marks ' ', double quotation marks denote a C-string (a null terminated character string). So you will need to replace the double quotes with single quotes. Next once you change to single quotes you can not define a single character with two single quotes next to each other ('') you must have at least 1 character (' '). If you want the character to actually be empty then you can use the null character '\0', or just 0 without any quotation marks at all.

Jim
Was This Post Helpful? 1
  • +
  • -

#15 kaiser0792  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 62
  • Joined: 15-December 10

Re: Multi-Dimensional Array Function Arguments

Posted 23 July 2011 - 12:57 PM

Thank you Jim. I should have known that. I'm working on a Computer Engineering degree and most of what I'm studying now is Circuit Analysis, really the Electrical Engineering portion of the degree. My coding is rusty; I do appreciate your taking the time to help me like you have.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1