1,494 Posted Topics
Re: 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? | |
Re: 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 … | |
| |
Re: [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 … | |
Re: 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. | |
Re: Try including the header file stdio.h | |
Re: [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 … | |
Re: 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. | |
Re: [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? | |
Re: 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] | |
Re: 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] | |
Re: [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. | |
Re: 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. | |
Re: [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 | |
Re: here's an example [url]http://www.cppreference.com/wiki/c/io/printf[/url] | |
Re: The problem...your trying to add two char pointers...I think. Could you post the rest of the code. | |
Re: [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 … | |
Re: 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. | |
Re: You may want to investigate conio.h or curese.h libraries for this behaviour. | |
Re: Woah...Don't use gets(). You run the risk of a buffer overflow, instead use fgets(). | |
Re: [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 … | |
Re: Well if you need to map the file's contents into the user's address space, then use mmap(). | |
Re: Myself, I've always preferred a simple editor like Gedit or Vim. | |
Re: Are you looking for Linux/Unix's ncures.h file? [url]http://math.hws.edu/orr/s04/cpsc225/curses.html[/url] | |
Re: You could start here: [url]http://www.advancedlinuxprogramming.com/alp-folder[/url] | |
Re: Yeah...I would say your in the wrong section | |
Re: [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 … | |
Re: Here's probably the best(free) ebook on asm for Nasm/Linux [url]http://www.drpaulcarter.com/pcasm/[/url] | |
Re: [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 … | |
Re: 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... | |
Re: You should find all you need in this link: [url]http://www.lysator.liu.se/c/bwk-tutor.html[/url] | |
Re: 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]’ … | |
Re: 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. | |
Re: In C octal numbers start with a zero like 01234; | |
Re: [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; }; … | |
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, … | |
Re: 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. | |
Re: [CODE] mystruct* A; [/CODE] You define A as a pointer to mystruct but never assign or allocate memory for it. | |
Re: 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 ); … | |
Re: [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 … | |
Re: 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 … | |
Re: Why not just have an accumulator and keep a running total there. [CODE] sum = 0; sum += getInt(); [/CODE] | |
Re: Try these links: [url]http://www.gtk.org/[/url] [url]http://qt.nokia.com/[/url] | |
Re: Sounds like homework to me...Lets see what you have so far. | |
Re: Not really sure what your question is... | |
| |
Re: [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] |
The End.