Oh ok now I see, thanks for the reply
Type: Posts; User: Albinoswordfish
Oh ok now I see, thanks for the reply
Now I've read this thread: http://cboard.cprogramming.com/c-programming/30324-what-does-malloc-do.html
I already know from the high-level perspective what malloc does. However I want to know how...
I guess I just learned about this new type of variable called a semaphore. I'm reading about it on wikipedia however I still don't get the clear picture..
What would be an example of when a...
But the OP is using character by character comparisons, so using if(string[0] == string[4]) is perfectly legit, the [] is already dereferencing the pointer.
Well in your while loop when you check if your buffer is equal to "quit\n" you can add a break statement to exit out of your while loop. However maybe I'm misinterpreting your problem and your...
I have a quick question,
lets say I have this two lines of code:
this.myWebClient.Headers.Set(HttpRequestHeader.ContentType, "text/xml");
string response =...
Right now I'm trying to create a UDP ping server. The client is basically going to send data in this format:
(4 byte integer): (text string)
I'm using the recvfrom() function to store data into...
Right now I'm trying to parse a CSV file however I keep receiving a segmentation fault. Below is part of my code where it is happening.
count = 1;
while(1){
if(count == 20) break;
...
oh wow I'm dumb, thanks a lot I've been wrestling with this problem for an hour now.
I'm trying to write a function that inserts an 'x' where ever two consecutive ',' appears in a string. Here is my function I have below:
void insertx(char * string){
char prev;
char curr;...
Here is my entire code:
void stripnew(char *);
int main(void){
FILE * fptr;
char c[1000];
char ** file;
Right now I'm having a problem using the strtok() function, it's giving a segmentation fault for some reason and I don't know why.
curr = strtok(file[0],",");
while(1){
curr =...
oh it might be cause my test initializations we're declared out of range of my declaration of test. But would that affect other variables?
I have an
int rownum //which is globally defined
in main I have
rownum = 0;
test[0][0] = '[';
test[0][1] = '1';
Well I know what the vector table for the hsc12 looks like. However I'm not quite sure how to build the actual table. This is what I have now.
typedef void (*near tIsrFunc)(void);
const...
Well actually more specifically I want to know how to build a interrupt vector table.
Right now I'm using codewarrior to program a hsc12 microcontroller using C. I want to figure out how to write ISRs (Interrupt Service Routines). The include file that comes with codewarrior has names...
I thought I knew how the preprocessor worked until I ran until a recent problem.
Say I have the declaration below:
#define INFILE dataset
then later in my main function I have
well lets say your given a string that is not null terminated would it still be possible with pointer arithmetic
I was just wondering if there was a standard function I could use
I know I can use pointers to get every character from a particular string such as
char * string = "hello";
char * i;
i = string;
for(;*i != '\0'; i++)
{
printf("%c",*i);
lets say instead of MAXINT I put in a negative number, however I want my program to not compile if this is the case how would I go about doing that?
I had an interview a while ago, one of the questions had to do with the assert command.
Lets say I had the below statement:
//main
assert(foo(MAXINT)) //is this the correct usage of assert?...
This is a pretty basic link list example, basically I think of a link list as an object that contains two things 1. A data entry 2.Pointer(s) to another object of the same type. This pointer(s)...
well can you use the math.h library which has the function pow(x,y) where
x^y in mathematical terms.
edit: I'm not quite sure what ^ does, I know it doesn't do exponentials but if someone could...