03-30-2011
NUM is not a variable. #define's do literal text substition at compile-time, which ends up trying to do send_items(items, item_name_length, &8 , &new_socket_fd);, which of course won't work.
This User Gave Thanks to Corona688 For This Post:
10 More Discussions You Might Find Interesting
1. Programming
Hi,
char *s="yamaha";
cout<<s<<endl;
int *p;
int i=10;
p=&i;
cout<<p<<endl;
1) For the 1st "cout" we will get "yamaha" as output. That is we are getting "content of the address" for cout<<s.
2) But for integer "cout<<p" we are getting the "address only".
Please clarify how we are... (2 Replies)
Discussion started by: sweta
2 Replies
2. UNIX for Dummies Questions & Answers
All ..
I am having a pointer array . And trying to store the addess into that pointer array . please see below the problem i faced
code:
int cnt1;
char *t_array;
char *f_array;
for(cnt1=0; cnt1<1000; cnt1++)
{
t_array =... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies
3. Programming
Hello,
I'm trying to write a method which will return the extension of a file given the file's name, e.g. test.txt should return txt. I'm using C so am limited to char pointers and arrays. Here is the code as I have it:
char* getext(char *file)
{
char *extension;
int i, j;... (5 Replies)
Discussion started by: pallak7
5 Replies
4. Programming
The below code throws the error, since the size of x = 19 is not passed to the cstrCopy function.
using namespace std;
static void cstrCopy(char *x, const char*y);
int main ()
{
char x;
const string y = "UNIX FORUM";
cstrCopy(x,y.c_str());
return 0;
}
void cstrCopy(char *x,... (3 Replies)
Discussion started by: SamRoj
3 Replies
5. Programming
I'm doing some coding in C++
Want to have a long empty string like below
const char ModMisfit :: DelStr = "\r \r";
However due to the long blank the line is very long. Is there any way to avoid this and keep the... (5 Replies)
Discussion started by: kristinu
5 Replies
6. Programming
Hi all,
Can anyone provide help with getting the right syntax regarding array/pointers in C in the following code? Can't locate a specific example which clarifies this...
Say I declare a typedef to an array of pointers to some type...
/**
* An array of ptrs to sections
*/
typedef... (4 Replies)
Discussion started by: gorga
4 Replies
7. Programming
if i create an array of pointers to a structure "struct node" as:
struct node *r;
and create "n" number of "linked lists" and assign it to the various struct pointers r using some function with a return type as structure pointer as:
r=multiplty(.......) /*some parameters*/
is... (2 Replies)
Discussion started by: mscoder
2 Replies
8. Programming
Hello,
The purpose of the program is to print a sub string from the prompt inputs. I do not understand why char pointer does not work but char array will for line 40 and Line 41.
./a.out thisisatest 0 8
substring = "thisisat"And my code is:
#include <stdio.h>
#include <stdlib.h>
#include... (29 Replies)
Discussion started by: yifangt
29 Replies
9. Programming
I am struggling with the pointer to 2D-array (cf: 2D array of pointers). Can anybody help me elaborate how the pointer x moves in the memory to access the individual of y, especially the high lighted lines?
I have talked to one of the curators of the forum, but I am still not quite clear.
Here... (1 Reply)
Discussion started by: yifangt
1 Replies
10. Programming
I am passing a char* to the function "reverse" and when I execute it with gdb I get:
Program received signal SIGSEGV, Segmentation fault.
0x000000000040083b in reverse (s=0x400b2b "hello") at pointersExample.c:72
72 *q = *p;
Attached is the source code.
I do not understand why... (9 Replies)
Discussion started by: jose_spain
9 Replies
LEARN ABOUT DEBIAN
prima::tie
Prima::Tie(3) User Contributed Perl Documentation Prima::Tie(3)
NAME
Prima::Tie - tie widget properties to scalars or arrays.
DESCRIPTION
Prima::Tie contains two abstract classes, "Prima::Tie::Array" and "Prima::Tie::Scalar", which tie an array or a scalar to a widget's
arbitrary array or scalar property. Also, it contains classes "Prima::Tie::items", "Prima::Tie::text", and "Prima::Tie::value", which tie
a variable to a widget's items, text, and value property respectively.
SYNOPSIS
use Prima::Tie;
tie @items, 'Prima::Tie::items', $widget;
tie @some_property, 'Prima::Tie::Array', $widget, 'some_property';
tie $text, 'Prima::Tie::text', $widget;
tie $some_property, 'Prima::Tie::Scalar', $widget, 'some_property';
USAGE
These classes provide immediate access to a widget's array and scalar property, in particular to popular properties as items and text. It
is considerably simpler to say
splice(@items,3,1,'new item');
than to say
my @i = @{$widget->items};
splice(@i,3,1,'new item');
$widget->items(@i);
You can work directly with the text or items rather than at a remove. Furthermore, if the only reason you keep an object around after
creation is to access its text or items, you no no longer need to do so:
tie @some_array, 'Prima::Tie::items', Prima::ListBox->create(@args);
As opposed to:
my $widget = Prima::ListBox->create(@args);
tie @some_array, 'Prima::Tie::items', $widget;
"Prima::Tie::items" requires "::items" property to be available on the widget. Also, it takes advantage of additional "get_items",
"add_items", and the like if available.
Prima::Tie::items
The class is applicable to "Prima::ListViewer", "Prima::ListBox", "Prima::Header", and their descendants, and in limited fashion to
"Prima::OutlineViewer" and its descendants "Prima::StringOutline" and "Prima::Outline".
Prima::Tie::text
The class is applicable to any widget.
Prima::Tie::value
The class is applicable to "Prima::GroupBox", "Prima::ColorDialog", "Prima::SpinEdit", "Prima::Gauge", "Prima::Slider",
"Prima::CircularSlider", and "Prima::ScrollBar".
COPYRIGHT
Copyright 2004 Teo Sankaro
You may redistribute and/or modify this module under the same terms as Perl itself. (Although a credit would be nice.)
AUTHORS
Teo Sankaro, <teo_sankaro@hotmail.com>. Dmitry Karasik, <dmitry@karasik.eu.org>.
perl v5.14.2 2009-02-24 Prima::Tie(3)