Forum: C Nov 14th, 2006 |
| Replies: 4 Views: 2,488 /**************************
* cgilib.h *
***************************/
typedef char *string;
typedef struct
{
string fieldName;
string value;
}oneField;
struct element { |
Forum: C Nov 14th, 2006 |
| Replies: 4 Views: 2,488 No, this is a C program. string is defined as a char* up top.
PS. I figured out the problem. Thanks |
Forum: C Nov 12th, 2006 |
| Replies: 4 Views: 2,488 This block of code will compile, but gives me a runtime error:
before the first comment is a header that is included in the file that you may need to analyze my code.
typedef char *string;... |
Forum: C Nov 5th, 2006 |
| Replies: 2 Views: 1,700 An array of characters is a string, and therefore checking the various methods available for strings in c would probably be a good start. Google strlen and see if that's any help. |
Forum: C Nov 5th, 2006 |
| Replies: 8 Views: 1,952 there's a function in C called strlen which returns the length of the string (in characters) you should probably use this method in your program. This website describes the function:
... |
Forum: C Nov 2nd, 2006 |
| Replies: 13 Views: 4,825 Probably dont even need &array to pass it to the function. The variable name itself should hold the beginning address. As a+i is the same as a[i]. |
Forum: C Nov 2nd, 2006 |
| Replies: 13 Views: 4,825 Please note that 2-d arrays are pointers to pointers. Not sure if this is the problem, but it could be if your having problem with 2-d arrays. |
Forum: C Nov 1st, 2006 |
| Replies: 13 Views: 4,825 Unfortunately you cannot return an array type in C, but you can pass back values through the parameters of your method to the array variable stored in main. To do so, pass the address of an array... |
Forum: C Oct 24th, 2006 |
| Replies: 10 Views: 2,438 Might be a stupid response, but do you know that chars and ints are able to be used interchangably (with a few restrictions) in C?
For example:
char a = 'a' + 1;
is the equivalent to
... |
Forum: C Oct 21st, 2006 |
| Replies: 20 Views: 4,226 Technically speaking, a array variable's name in C, as defined in numerous C books, such as "A Book on C" (Fourth edition) is a value referring to the address of the beginning element in the array. ... |
Forum: C Oct 21st, 2006 |
| Replies: 20 Views: 4,226 Technically incorrect. C only supports 1 parameter passback method, pass by value. However, the value of an array variable name contains an address, which is why arrays can be mutated by passing in... |
Forum: C Oct 21st, 2006 |
| Replies: 4 Views: 3,929 Well, If you are checking after each entered number (which is what it looks like) you need to compare the entered number to the answer matrix (you could have this as a variable in the program... |