Ah, such stupid mistakes! I wasn't paying close enough attention to what I was doing. Thank you Salem!
Type: Posts; User: slowcoder
Ah, such stupid mistakes! I wasn't paying close enough attention to what I was doing. Thank you Salem!
For all list_count entries, I would like to print out e_list to a text file. However, I receive the error: "warning C4133: 'function' : incompatible types - from 'struct _iobuf *' to 'const char *"...
maxorator, thank you for the explanation; it makes a lot more sense now. Worked perfectly :)
Within this function:
static void horiz_edge(void)
{
int y;
int line_no;
int current;
int *pe_ptr;
int *ne_ptr;
So just to verify that I interpreted that properly, this would be the equivalant?
int multi_tile, norec, opt_DM;
/*some code*/
if ((norec != 0) && (opt_DM < 32))
multi_tile = 1;
else
Perfect, thank you for all the explanations.
One more simple question that is similar.
int multi_tile, norec, opt_DM;
/*some code*/
multi_tile = norec && opt_DM < 32;
When something like this is done in C:
int i;
const static char phase[] = "urrrddd";
for (i = 0; phase[i]; i++)
{
/* some code */
}
Thank you vart, that worked perfectly :)
brewbuck, I did a search about allocating the memory dynamically and found this post below. However, is this the best way to do it? I have a hard time...
brewbuck, I'm going to use something similar to what you had:
const char validCharacters[] = "0123456789ABCabc";
int isCharValid(int ch)
{
return strchr(validCharacters, ch) != NULL;
}
Thanks for everyone's input! It's greatly appreciated.
I've gone through all the examples and have played around with the code to understand it better. The one question that came up was how can...
I'm teaching myself C, and I've never had to deal with user input before so I need some assistance. For the program I want to create, a user is allowed to input any amount of numbers (no negatives)...
nevermind...i figured it out...just needed to use the function strncat()...found an online tutorial that gave me the answer...
I have a program that I've been using as reference (not written by me and fully works), and I noticed that there's a line of code:
*txt_ptr++ = '\\';
where \\ is added to the end when it gets...
Adak, I read that page over and the explanation wasn't totally clear.
In my program, I changed it to:
encodation = encodeB(dataCharacter1, j);
encodation++;
but when I did: ...
Reading the book over and over, it seems that this line below should work, because it increments the pointer. However, this line doesn't work either. Still confused.
*encodation++ =...
robatino, thank you for the links. I changed my main function accordingly and bookmarked that page for future reference so I don't make that mistake again. I'm still digesting the malloc page, and...
I plotted everything out on paper and I guess I just don't know enough about C to get my result. When I translated my steps, the compiler does not like my syntax.
For the function: char...
MacGyver, thank you for the explanation. I'm teaching myself how to do everything via the internet and the C Programming Language book...guess I'm not teaching myself that well :(
Stepping...
So are you saying I need to change this function:
char encodeB(int dataCharacter, int position)
{
char bEncodation[2];
if (dataCharacter == 0)
{
if (position == 0)
Okay, here's a simplified version of my program:
/* INCLUDES */
#include <stdio.h>
int lookupTable(char dataCharacter1, char dataCharacter2);
char encodeB(int dataCharacter, int position);...
I'm hoping a C programmer will know the answer to this:
I have to convert some C code into VB: What would void * equate to in VB?
ex:
void *JOutput;
Thanks!!
Thanks Salem...I was trying to be more complicated then what was really called for :)
char *t_ptr;
int *ts;
case 555:
strcpy(t_ptr, "\\555\\");
t_ptr += 5;
strcpy(t_ptr, (char *) ts);
break;
I just need to concatenate t_ptr and ts, but my line of code: strcpy(t_ptr,...
I just want my output to be \927\ rather than \:927\
I'll try to get all the code that has to do with the output...unfortunately there's a lot of code that I have to sort through to figure out...
*txt_ptr++ = '\\';
*txt_ptr++ = (char)strcat(txt_ptr, "\\927\\");
I have these two lines of code within my program and the output I would hope to get would be: \927\
However, the output I get...