Search Results

Search: Posts Made By: tornow
Forum: Programming 09-12-2013
3,304
Posted By Corona688
If you don't define a function's contents with {...
If you don't define a function's contents with { } right then and there, it'll be assumed to be extern. This is very unlike variables, which never assume they're external unless you say so.
...
Forum: Programming 09-10-2013
3,304
Posted By jim mcnamara
Here is how extern works. You have three C...
Here is how extern works.

You have three C files. File1 declares the variable foo (we are just doing variables, functions work the same).

int foo;

File2 and File3 both use the variable. ...
Forum: Programming 09-09-2013
3,304
Posted By Corona688
You got it exactly backwards. You should put...
You got it exactly backwards.

You should put this in the header file:

extern const char ack_msg[];


...and this in one and only one C file, call it "data.c" perhaps:

#include "data.h"
...
Forum: Programming 05-25-2013
1,615
Posted By Don Cragun
The size of a pointer to a character is a...
The size of a pointer to a character is a constant in any particular program; whether that pointer points to a single character or to a nul-byte terminated string of 100 characters does not affect...
Forum: Programming 05-25-2013
1,615
Posted By Don Cragun
Here is a modified version of your code with a...
Here is a modified version of your code with a few changes and lots of comments added. Please read through the code, examine the output, and let me know if something is still confusing:
#include...
Forum: Programming 05-20-2013
2,190
Posted By Corona688
numlist holds two and only two things: 1) A...
numlist holds two and only two things:
1) A pointer to memory
2) An integer

Does a pointer get bigger or smaller? No... A pointer is just a number, always the same size.
Forum: Programming 05-17-2013
2,190
Posted By migurus
Yes, you have to keep a variable wich keeps...
Yes, you have to keep a variable wich keeps number of elements in your array.

In many situations I find it convenient to hold ptr to array and counter together in one simple structure. If element...
Forum: Programming 05-20-2012
2,287
Posted By neutronscott
linelist[index] = line; line here is a...
linelist[index] = line;


line here is a pointer to something returned earlier. so you've set each element to point to the same place. you malloc enough for the string. you'd want to copy it...
Forum: Programming 12-08-2011
2,714
Posted By siva shankar
Hi friend, The code is not only for...
Hi friend,

The code is not only for n=0, its in a for loop. Let me explain with an example.

If s contain a string "5270", then the loop continue for 4 times:

1st : 10*0 + 5 = 5
2nd :...
Forum: Programming 12-07-2011
2,714
Posted By fpmurphy
Simplifies the code. If not done this way, you...
Simplifies the code. If not done this way, you would have to have extra code to handle the n = 0 case.
Showing results 1 to 10 of 10

 
All times are GMT -4. The time now is 10:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy