09-23-2009
10 More Discussions You Might Find Interesting
1. Programming
using namespace std;
void g();
class A {
public :
A() { g();g();g(); cout << "Constructor of A"<< endl ;}
};
inline void g(){ cout << "vijay" <<endl; }
int main() {
A a;
}
when i use inline i get size 303488 Aug 31 12:05 a.out*
when not using inline i get size 303572 Aug 31... (1 Reply)
Discussion started by: vijaysabari
1 Replies
2. Programming
i have a function:
char *pcCityIdToCountryName(ADMIN_DB_DATA *pstHEader, unit uiCityID)
this returns a pointer to CountryName if cityId is given.
to retrieve countryname i give:
char *CountryName;
CountryName = pcCityIdToCountryName(..................);
but when i compile it is giving :... (5 Replies)
Discussion started by: jazz
5 Replies
3. Programming
Hello all
im trying to build function that will return void function pointer
what is mean is ( not working )
the main function
void * myClass::getFunction(int type){
if(type==1)
return &myClass::Test1;
if(type==2)
return &myClass::Test2;
}
void myClass::Test1(){... (1 Reply)
Discussion started by: umen
1 Replies
4. Programming
#include <iostream>
using namespace std;
class A
{
public:
int Getvalue() { return i;}
private:
int i;
};
int main()
{}
The above code compiles properly in g++ or in any other C++ compiler.
BUT, the variable 'i' is used (in 'return i' statement) before it is... (1 Reply)
Discussion started by: deepthi.s
1 Replies
5. Programming
Hi guys.
how a functions such fdopen, ... can return pointer?
are these functions use static memory(variables)? (6 Replies)
Discussion started by: majid.merkava
6 Replies
6. 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
7. Programming
Hi,
In the below C code,
#include <stdio.h>
void print() {
printf("Hello\n");
}
int main() {
void (*f)() = (void (*)()) print;
f();
(*f)();
}
I wonder, how the syntaxes "f()" and "(*f)()" are treated as same without any error? Is this an improvement or ANSI/ISO... (1 Reply)
Discussion started by: royalibrahim
1 Replies
8. Programming
Have difficulty to understand this pure C code to only print vowels twice from input string. Questions are commented at the end of each place.
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
/*
*Demonstrate the use of dispatch tables
*/
/*Print a char... (11 Replies)
Discussion started by: yifangt
11 Replies
9. 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
10. Shell Programming and Scripting
Hi All,
Good Day, seeking for your assistance on how to not perform my 2nd, 3rd,4th etc.. function if my 1st function is in else condition.
#Body
function1()
{
if
then
echo "exist"
else
echo "not exist"
}
#if not exist in function1 my all other function will not proceed.... (4 Replies)
Discussion started by: meister29
4 Replies
LEARN ABOUT LINUX
ipq_set_verdict
IPQ_SET_VERDICT(3) Linux Programmer's Manual IPQ_SET_VERDICT(3)
NAME
ipq_set_verdict -- issue verdict and optionally modified packet to kernel
SYNOPSIS
#include <linux/netfilter.h>
#include <libipq.h>
int ipq_set_verdict(const struct ipq_handle *h, ipq_id_t id, unsigned int verdict, size_t data_len, unsigned char *buf);
DESCRIPTION
The ipq_set_verdict function issues a verdict on a packet previously obtained with ipq_read, specifing the intended disposition of the
packet, and optionally supplying a modified version of the payload data.
The h parameter is a context handle which must previously have been returned successfully from a call to ipq_create_handle.
The id parameter is the packet identifier obtained via ipq_get_packet.
The verdict parameter must be one of:
NF_ACCEPT
Accept the packet and continue traversal within the kernel.
NF_DROP
Drop the packet.
NF_QUEUE
Requeue the packet.
NF_STOLEN and NF_REPEAT are kernel-internal constants and should not be used from userspace as their exact side effects have not been
investigated.
The data_len parameter is the length of the data pointed to by buf, the optional replacement payload data.
If simply setting a verdict without modifying the payload data, use zero for data_len and NULL for buf.
The application is responsible for recalculating any packet checksums when modifying packets.
RETURN VALUE
On failure, -1 is returned.
On success, a non-zero positive value is returned.
ERRORS
On error, a descriptive error message will be available via the ipq_errstr function.
BUGS
None known.
AUTHOR
James Morris <jmorris@intercode.com.au>
COPYRIGHT
Copyright (c) 2000-2001 Netfilter Core Team.
Distributed under the GNU General Public License.
SEE ALSO
iptables(8), libipq(3).
Linux iptables 1.2 16 October 2001 IPQ_SET_VERDICT(3)