1,494 Posted Topics

Member Avatar for watery87

Right away I can see that your server is not reading the request from the client. So how does your server get the country value or does it send everything with each request?

Member Avatar for watery87
0
479
Member Avatar for Newtothis123

Here's the return value of strmp RETURN VALUE The strcmp() and strncmp() functions return an integer less than, equal to, or greater than zero if s1 (or the first n bytes thereof) is found, respectively, to be less than, to match, or be greater than s2. The ! operator negates …

Member Avatar for ftl25
0
678
Member Avatar for kadams
Member Avatar for ronnyrhymes

[QUOTE=ronnyrhymes;1293582]Thanks faxo and ancient dragon. Ancient Dragon i tried out your code however no value was printed out. Faxo, I also think its a good idea to use the fgets. However it should have been just gets since i'm not dealing with files over here.[/QUOTE] Not sure what you mean …

Member Avatar for ronnyrhymes
0
122
Member Avatar for chade25

If you interested in 'low level' and kernel programming then may I recommend picking up a book on inline assembler. [url]http://ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html[/url] Plus I would investigate several books on kernel/operating system programming.

Member Avatar for gerard4143
0
129
Member Avatar for dsrepublic
Member Avatar for evinkeating
Member Avatar for johndoe444

[QUOTE=Ancient Dragon;1280626]There is an old saying -- "garbage in, garbage out". What you posted is not even C code. I don't know what it is, but he certainly isn't C or C++ languages.[/QUOTE] That would be the output of the GNU gdb (debugger)....And yes C does blow sometimes. Maybe if …

Member Avatar for gerard4143
0
126
Member Avatar for johndoe444

When a function returns, it uses whatever is in the %rax register as its return value. Your function may inadvertently be placing the right value in %rax. Note: I won't rely on this behaviour.

Member Avatar for gusano79
0
103
Member Avatar for dsrepublic

[QUOTE=dsrepublic;1279641]AD, thanks for the help. I'm still having trouble understanding the first part though. Could you explain how (int *)(pc+i)== pa + 3 yields i = 12?[/QUOTE] I quickly looked at your posting and have one question int *pa=arr What's arr?

Member Avatar for Ancient Dragon
0
119
Member Avatar for ankush chander

I not sure where your getting your information from but its old. Try this link: [url]http://tldp.org/LDP/lkmpg/2.6/html/[/url]

Member Avatar for ankush chander
0
462
Member Avatar for makaveli0129

I'm no expert programming with 16 bit Intel or boot floppies(only did it once out of curiosity) but here's a website that addresses your question [url]http://www.emu8086.com/assembly_language_tutorial_assembler_reference/asm_tutorial_09.html[/url]

Member Avatar for ko3dm
0
249
Member Avatar for csmgsarma

[QUOTE=csmgsarma;1276886]@ Ancient Dragon, if both are same,why is there a difference in code size in both cases. The initialization of global variables happens before the main() takes off, loosly at the startup. Isn't it?[/QUOTE] Please read Ancient Dragon's post for the answer.

Member Avatar for gerard4143
0
1K
Member Avatar for archana.c07

Try strtol() long int strtol(const char *nptr, char **endptr, int base); DESCRIPTION The strtol() function converts the initial part of the string in nptr to a long integer value according to the given base, which must be between 2 and 36 inclusive, or be the special value 0.

Member Avatar for Software guy
0
260
Member Avatar for bilalqasim

[QUOTE=bilalqasim;1004523]Please can anyone help me in the making of this program : We have to Enter a string of capital letters like WJKTYNHJHIJKLMNOPASC THE LONGEST CONSECUTIVELY INCREASING STRING IS HIJKLMNOP . . . Help me Please , Thanks !!![/QUOTE] You are not giving enough information..please elaborate

Member Avatar for steventaal
0
125
Member Avatar for shankarz
Member Avatar for kings_mitra
0
107
Member Avatar for dy/dx

The problem...your trying to add two char pointers...I think. Could you post the rest of the code.

Member Avatar for gerard4143
0
165
Member Avatar for Jeevitha V.K

[QUOTE=Jeevitha V.K;1258591]Hi ... i am doin my B.E in computer science amd i was asked to write a programme ... can anyone help me write a c program that can hang the system ... and can u also tel me how to set it right again...[B][COLOR="Green"]:icon_neutral:[/COLOR][/B] and can u tel …

Member Avatar for finito
-6
159
Member Avatar for shankarz
Member Avatar for jhaycee12
Member Avatar for shankarz

This is what my help files say about fgets return value... char *fgets(char *s, int size, FILE *stream); gets() and fgets() return s on success, and NULL on error or when end of file occurs while no characters have been read.

Member Avatar for Ancient Dragon
0
82
Member Avatar for neotaunter
Member Avatar for midget66

Woah...Don't use gets(). You run the risk of a buffer overflow, instead use fgets().

Member Avatar for kings_mitra
0
128
Member Avatar for baillot

[QUOTE=baillot;1266003]Hello I am sorry if this is a dumb question but is it conceivable to determine the memory address of a function that is inside a running application from another application? Say I have an application A that has a function helloWorld(). A is being launched. I would like to …

Member Avatar for gerard4143
0
173
Member Avatar for abhi74k

Well if you need to map the file's contents into the user's address space, then use mmap().

Member Avatar for gerard4143
0
79
Member Avatar for kymarscheng
Member Avatar for tokenjoker187
0
257
Member Avatar for jmangu

Are you looking for Linux/Unix's ncures.h file? [url]http://math.hws.edu/orr/s04/cpsc225/curses.html[/url]

Member Avatar for jonsca
0
124
Member Avatar for Madawar

You could start here: [url]http://www.advancedlinuxprogramming.com/alp-folder[/url]

Member Avatar for lionaneesh
0
125
Member Avatar for NewOrder
Member Avatar for n30h4x

[QUOTE=n30h4x;1259832]Ok, well what about in *nix?? Wouldn't a way to achieve this is to have the program in the background to be looking for a file, that the other program will create with the command. If it finds a file, it opens it extracts the command and performs it. Is …

Member Avatar for n30h4x
0
205
Member Avatar for DrakeMagi

Here's probably the best(free) ebook on asm for Nasm/Linux [url]http://www.drpaulcarter.com/pcasm/[/url]

Member Avatar for gerard4143
0
182
Member Avatar for noobuser

[QUOTE=noobuser;1258859]hi guys is it timeconsuming to use memset instead of for? i mean suppose we have an array of int int prime[200000]; we use memeset(prime, 200000, 0, sizeof(prime)) also we can use for(i = 0; i < 200000; i++) prime[i] = 0;[/QUOTE] I would expect memset() to be optimized for …

Member Avatar for Ancient Dragon
0
207
Member Avatar for riyasahamed

If your looking for the code with no effort then Google, the web has all kinds of examples out there for the taking. If you require help getting your code working, then please post what you have so far and we'll have a look at it...

Member Avatar for lionaneesh
-1
128
Member Avatar for Hawking

You should find all you need in this link: [url]http://www.lysator.liu.se/c/bwk-tutor.html[/url]

Member Avatar for kiran002
-3
109
Member Avatar for anjoz

I tried compiling your program and got numerous errors test.c:4:1: warning: return type defaults to ‘int’ test.c: In function ‘main’: test.c:19:2: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘char (*)[50]’ test.c:36:2: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘char (*)[10]’ …

Member Avatar for Adak
0
2K
Member Avatar for cmsc

bst.h Is a header file. You don't compile header files. If your looking for the process, creating a library, you should state for which operating system and compiler and type of library.

Member Avatar for Saravanan5
0
73
Member Avatar for NewOrder
Member Avatar for prashanth s j

[QUOTE=prashanth s j;1176268]Hi all, the following code prints garbage values. I want to read from an array two bytes and print then as a short int after doing ntohs. What is the bug in the code? Thanks and Regards, Prashanth [code] #include<stdio.h> struct converter { unsigned short int i; }; …

Member Avatar for prashanth s j
0
194
Member Avatar for gerard4143

I have a question about functions and pointers to functions.... Why does a C program treat a function call to a function and a function call to a function pointer the same? [CODE] #include <stdio.h> #include <stdlib.h> typedef void (*funcptr)(void); void myfunc(void) { fputs("Hello, World!\n", stdout); } int main(int argc, …

Member Avatar for gerard4143
0
176
Member Avatar for learnerAccess

try this printf ("value : %u\n", *(unsigned char*)(p + i)); This will cast and dereference a byte starting at p + i...You had casting and dereferencing an int starting at p + i which will overflow past n = 0x000000ff.

Member Avatar for learnerAccess
0
91
Member Avatar for socket_to_me

[CODE] mystruct* A; [/CODE] You define A as a pointer to mystruct but never assign or allocate memory for it.

Member Avatar for abhimanipal
0
98
Member Avatar for Iam3R

Should you be using SEEK_SET in this loop maybe try using SEEK_CUR [CODE] while ( ! feof( infp) ) // entering infinite dont know cause { fread ( &P, sizeof ( P ), 1 , infp ); cnt_rec++; fseek( infp, sizeof(P) * ( cnt_rec - 2 ) , SEEK_SET ); …

Member Avatar for Adak
0
1K
Member Avatar for Ferny84

[CODE] char (&decision = "PASSED"); [/CODE] The above code is not allowed. If you need to compare strings then include the string.h header and use strcmp(). Ooops, I think you might be trying to set decision equal to "PASSED". If you want that to happen then change decision to a …

Member Avatar for csmgsarma
0
124
Member Avatar for saw77

Here's a blurb from manpages malloc which discusses buffer overflows(its in the second half). [QUOTE] NOTES Normally, malloc() allocates memory from the heap, and adjusts the size of the heap as required, using sbrk(2). When allocating blocks of mem‐ ory larger than MMAP_THRESHOLD bytes, the glibc malloc() implementation allocates the …

Member Avatar for saw77
0
217
Member Avatar for Don_k

Why not just have an accumulator and keep a running total there. [CODE] sum = 0; sum += getInt(); [/CODE]

Member Avatar for Aia
0
76
Member Avatar for Tellalca

Try these links: [url]http://www.gtk.org/[/url] [url]http://qt.nokia.com/[/url]

Member Avatar for gerard4143
0
110
Member Avatar for myth_terry
Member Avatar for jskelly
Member Avatar for jephthah
Member Avatar for camdaddy09

[QUOTE=camdaddy09;1219464]this cant possibly be that hard to answer?[/QUOTE] Like you said "this cant possibly be that hard to answer". I just google C >> and checked wiki C/Operators and there they were... [URL="http://en.wikipedia.org/wiki/C_%28programming_language%29"]http://en.wikipedia.org/wiki/C_%28programming_language%29[/URL]

Member Avatar for omol
-4
109

The End.