|
|
Up |
|
|
  |
Author: jonjon
Date: Feb 4, 2008 15:41
I'm writing a program (doesn't matter what it does) and I have
distributed it, but I have had to make some more adjustments, and
before I ask everyone to update their programs, I was wondering if it
was possible to write a program to go with it to access a server and
download the newest updates (like Spybot does). If their is any
libraries or tutorials to point me to, point away.
|
| |
|
| |
no comments
|
|
  |
|
|
  |
Author: Nikhil BokareNikhil Bokare
Date: Feb 4, 2008 10:25
#include
int main()
{
int a[3][3][3];
printf("%%d %%d %%d %%d",a,*a,**a,&a);
}
I tried the above code and got the same value for a, *a , **a and &a.
Can anyone please tell me the reason behind such a behavior?
|
| |
|
16 Comments |
|
  |
Author: TDBTDB
Date: Feb 4, 2008 09:57
int main() {
void *p;
p=(void *)0x00000005;
// Here
printf(" %%d ",* (int *)p);
return 0;
}
When I executed the above code using GCC and VC++, it caused
segmentation error and windows error..
I need a condition that can find whether the pointer address will
cause error or not..
Any suggestions to construct that condition ?
|
| |
|
4 Comments |
|
  |
Author: vardhanvardhan
Date: Feb 4, 2008 09:27
Hi,
Im not sure if this is the righ forum for this question. Pls redirect
me to the correct forum in that case.
I have a requirement to implement a memory pool meant for storing
pointers only (which constiture an iterator over an array type data
structure). Heap allocations are to be kept to a minimum (e.g. only
while expanding the pool size). Memory for an instance of an iterator
should be contiguous ideally, but since this may not always be
possible a block based allocation could be thought of. This however
adds an overhead to maintain a linked list, free list etc. Also no
list of pointers should be created outside the pool as this
constitutes heap allocation. Is there some literature which can
address this specific problem in terms of the possible approaches?
Maybe more generically - methods for contiguous dynamic memory
allocation, given a certain usage profile?
thanks for your advice,
Vardhan
|
| |
|
no comments
|
|
  |
Author: Morris DoveyMorris Dovey
Date: Feb 4, 2008 09:14
TDB wrote:
>
> int main() {
> void *p;
>
> p=(void *)0x00000005;
>
> // Here
> printf(" %%d ",* (int *)p);
>
> return 0;
> }
>
> When I executed the above code using GCC and VC++, it caused
> segmentation error and windows error..
>
> I need a condition that can find whether the pointer address will
> cause error or not..
>
> Any suggestions to construct that condition ? ...
|
| Show full article (0.88Kb) |
|
1 Comment |
|
  |
Author: Morris DoveyMorris Dovey
Date: Feb 4, 2008 08:53
vardhan wrote:
> I have a requirement to implement a memory pool meant for storing
> pointers only (which constiture an iterator over an array type data
> structure). Heap allocations are to be kept to a minimum (e.g. only
> while expanding the pool size). Memory for an instance of an iterator
> should be contiguous ideally, but since this may not always be
> possible a block based allocation could be thought of. This however
> adds an overhead to maintain a linked list, free list etc. Also no
> list of pointers should be created outside the pool as this
> constitutes heap allocation. Is there some literature which can
> address this specific problem in terms of the possible approaches?
> Maybe more generically - methods for contiguous dynamic memory
> allocation, given a certain usage profile?
More info whould help. It sounds as if you could use anything
from an array of pointers to an array or linked list of iterator
structures, depending on your specific requirements.
|
| Show full article (1.06Kb) |
|
no comments
|
|
  |
Author: DougDoug
Date: Feb 4, 2008 08:45
Hi folks,
I'm new to this group but I've been working with C, C++, Java, abit of
assembly, and the learners favourite VB. Anyway, I'm working on a
project for my Doctorate and needed some help and advice. I'm looking
for a (preferrably electronic) copy of the C99 standard TC3 (I found
TC2 easily, TC3 seems to be hard to get at the moment unless I missed
it somehow).
Further, although I know boards like this are great for getting
helpful advice about C, I was hoping to be directed to 'official'
discussions with minutes or similar (working groups, standards
committees, that sort of thing) for the sake of research and sourcing.
Pacifically, I'm looking presently for talks about the preprocessor
phase of compiling and unspecified or ambiguous area's of the
standard. For example, if one were to run purely from the standard,
its justifiable either way as to whether 'sizeOf' and type-casts are
accepted as apart of a #if conditional.
Anyway, thanks in advance for any help or assistance rendered ;)
Doug
|
| |
|
4 Comments |
|
  |
Author: TrickyTricky
Date: Feb 4, 2008 08:02
Is there a way I can easily convert a char array into an int array,
without having to cast each value in the array to an int and copying
it to a new array?
Thanks for any help :)
|
| |
|
8 Comments |
|
  |
|
|
  |
Author: al.moorthial.moorthi
Date: Feb 4, 2008 07:17
the below program is working in Suse and not working on Cent 5:
can any body have the solution ?
#include
#include
#include
int main(){
char cool[] = "http://www.cnn.com:80/wowsers.html";
regex_t test_reg;
regmatch_t matches[3];
int num_matches;
int success = regcomp(&test_reg, "http://([^/]*)(/{0,1}.*)",
REG_EXTENDED | REG_ICASE);
printf("regcomp success = %%d\r\n", success);
success = regexec(&test_reg, cool, num_matches, matches, 0);
printf("regexec success = %%d\r\n", success);
|
| Show full article (1.76Kb) |
|
3 Comments |
|
|
|
|