1,494 Posted Topics
Re: Well I tried and....the number of errors and warning...oh my. [CODE] #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <pthread.h> #include <semaphore.h> void *A(void *arg); void *B(void *arg); void *C(void *arg); int main() { int res, total=0; pthread_t b_thread, e_thread, s_thread; void *thread_result; res = sem_init(&A,B,C 0, 0); if(res … | |
Re: If the compiler will generate the proper machine codes and the linker will produce the proper addresses then yes it will produce executable code....The only remaining obstacle is wrapping the executable code in a format recognized by the operating system... | |
Re: It doesn't matter where you initialize the mutex...Just do it before you read or write to the shared resource and then set/unset(lock/unlock) the mutex with each read and write. | |
Re: If you check the manpages for strftime, you'll find a complete and working program at the bottom of the listing.. | |
Re: [QUOTE=daveoffy;1182598]Hello, I have been trying to setup mysql API with C. I followed tutorials but I don't think I am installing the API correctly. Could someone tell me the package to download, and what to do with it. Thank you very much.[/QUOTE] On this page you should find a link … | |
Re: Try looking at the macro BUFSIZ. I found this about BUFSIZ [QUOTE] Macro: int BUFSIZ The value of this macro is an integer constant expression that is good to use for the size argument to setvbuf. This value is guaranteed to be at least 256. The value of BUFSIZ is … | |
Re: Is this a C or Cpp progect? If its a C project try including the string.h header. | |
Re: Here's what manpages has to say about return values for fcsanf() [QUOTE] RETURN VALUE These functions return the number of input items successfully matched and assigned, which can be fewer than provided for, or even zero in the event of an early matching failure. The value EOF is returned if … | |
Re: [QUOTE=prade;1178411]hi, i i recently installed dev c++ 4.9.9.2 ....the first hello world program i wrote gave me some insane messages when i compiled & the exe files which gets created...my antivirus detects them as trojan flies & deletes them....i tired & re -installed dev again but it didnt help...please help … | |
Re: [QUOTE=johndoe444;1178013]why is there a + infront of 100k but a - infront of 500k?[/QUOTE] You really should familiarize yourself with manpages [CODE] TESTS Some tests, for example -newerXY and -samefile, allow comparison between the file currently being examined and some reference file spec‐ ified on the command line. When these … | |
Re: Did you try investigating setjmp, longjmp. Also sometimes, for efficiency, goto's are the best solution. | |
Re: The best way to understand Linux/Unix is the shell and shell programming. If you have a solid understanding of how these features work...Then you have a solid understanding of Linux/Unix. | |
Re: Close enough.... | |
Re: I tried googling 'C programming exercises' and got a page full of results. | |
Re: [QUOTE=AngusFloydKAOS;1175182]Hey so I'm trying to get one of my c variables to be a bash variable. Is there a way that I can do this?[/QUOTE] Exactly what do mean by 'to be a bash variable'. Do you mean the variable is shared between the C program and the shell or … | |
Re: Try googling bash tcp [url]http://thesmithfam.org/blog/2006/05/23/bash-socket-programming-with-devtcp-2/[/url] | |
Re: I would use the sort utility for this one.. | |
Re: Maybe if you gave us an example of filenames and then the filtered list. | |
Re: I always understood that's what its supposed to do...generate web script or pages. | |
Re: Your missing a '}' in your if statement. Check right before the else. | |
Re: Here's what the manpages have to say... [QUOTE] RETURN VALUE If any of the exec() functions returns, an error will have occurred. The return value is -1, and errno will be set to indicate the error. [/QUOTE] | |
Re: [QUOTE=Chris_Giarla;1175235]Is there a difference between %ecx and (%ecx) I don't really care at this point about specific register uses, just consider %ecx a general purpose register for my question. I know that if you have a base pointer (%ebp) and you want to reference a location based on that, you … | |
Re: You should take a look at this link, You'll find manpages has 8 sections [url]http://linuxmanpages.com/[/url] | |
Re: This question is asked so many times that a sticky should be made. Check out this link: [url]https://www.securecoding.cert.org/confluence/display/cplusplus/EXP34-C.+Do+not+depend+on+order+of+evaluation+between+sequence+points[/url] Plus I'm not sure if this is a typo or not a++ + b++ + ++b + ++ a + a++ You have a space between ++ a....Its just harder to read … | |
Re: We provide help, or answers to specific questions..So what have you tried so far? What is your specific question? | |
Re: [QUOTE=junezy4;1173263]I need the coding for the following question in C: Read and print all the consonants from a file (no duplicates). Assume the file is a .txt file. The consonants are then to be sorted in alphabetical order.[/QUOTE] Again, read this [url]http://www.daniweb.com/forums/announcement118-2.html[/url] | |
Re: try printing out the sizeof(void*) and the sizeof(unsigned int); Are the values the same? | |
Re: [QUOTE=bulgin;1173130]Is there a method in Linux to monitor a port for activity, then when found, execute a script? For example, when tftp port 69 is accessed, run a script that runs commands? thank you.[/QUOTE] I'm going to say no but any ftp program should have the ability to log any … | |
Re: wc - word count with the -l option count the number of newlines This is right from man wc [QUOTE] -l' `--lines' Print only the newline counts. [/QUOTE] | |
Re: [QUOTE=bohongtw;1171175]hi there i have an assignment about writing Cshell with some features i m not gonna ask plz gimme the codes or smth. but i need some advice how to start writing it, what to do maybe smn can show me ways to do it , thanks for help here … | |
Re: I would check the number of } braces you have in your function definition. Also calling a function print is probably a bad idea, considering you already have fprintf, printf, sprintf, vprintf, ... defined in the standard library. Why these lines? [CODE] #include <iostream> using namespace std; [/CODE] | |
Re: [QUOTE] I am not sure what this means and I get it all the time. [/QUOTE] Really and what would that be? [QUOTE] Can someone help me fix this code? [/QUOTE] What's wrong with it beside not having code tags? | |
Re: [QUOTE=southtucky;1167721]First let me say I am thankful I found these forums for assembly, and that I am a complete newbie. I've been reading documentation, and even bought a book on learning assembly, however, there is still one question I have that baffles me. I would appreciate it if someone could … | |
Re: [QUOTE] but its not working as i expected. [/QUOTE] What were you expecting...my crystal ball's on the fritz and the Amazing kreskin is busy right now.. | |
Re: You really should check the results of this action [CODE] fp=fopen(argv[i], "r"); [/CODE] Something like [CODE] if (!(fp=fopen(argv[i], "r"))) { fprintf(stdout, "could not open %s\n", argv[i]); exit(EXIT_FAILURE); } [/CODE] | |
Re: The forums purpose is to provide assistance not complete solutions...Please post what you have completed so far and any detailed questions. As for the meaning... Since I'm not in your class I can only speculate about the absolute meaning of the question... To me it seems you have to open … | |
Re: Could you give use an example of what the filename looks like after its been modified. | |
Re: Try zeroing str[] or declaring it as global...Plus please use fgets() instead of scanf()...Like below [CODE] #include<stdio.h> char str[100]; void reverse(char str[]); int main() { int i; printf("Enter to reverse : "); fgets(str, 100, stdin); reverse(str); return(0); } /* Function */ void reverse(char str[]) { int i; for(i=99;i>=0;i--) { printf("%c",str[i]); … | |
Re: Line 18...Why do you have a brace there? Also line 55 printf("Your change is %f" ); What are you printing? Where is the float variable? | |
Re: [QUOTE=scourge.hellion;1167593]hey guys !:) well (00401034 . 322E XOR CH,BYTE PTR DS:[ESI]) and (00401031 ,65:72 33 JB SHORT messagee.00401067) these are out of ollydbger:) compare them both and can u tell me if the middle column i mean 322e n 65:72 33 are the same? like 657233h is the same as … | |
Re: Try this link: [url]http://caml.inria.fr/pub/docs/old-311/libref/Scanf.html[/url] | |
Re: If this is a Linux/Unix program then you have to compile with -lcurses gcc filename.c -o filename -lcurses | |
Re: [QUOTE=cryptacker;1164740]hi everyone, I've had a problem with my operating system project (it's just simple cmd line xD ) it's easy but i couldn't find it ;) how i can list folders and files in drive A? my assembler is -nasm and i'm using 16 bit real mode .(kernel) -cryptacker[/QUOTE] What … | |
Re: [QUOTE=W4W;1165359]Hiii all i hav i little problem i wanna insert a char into an another char and add some other chars .. :D For example : I have the char A = "HE"; i wanna have in B ="HELLO Everybody"; i was doing this in php : [CODE] $string=$A."LLO Everybody";[/CODE] … | |
Re: [QUOTE=boogahubba;1165172]Hello,I just started learning grep at school and I can't figure out why my syntax is incorrect.I have to solve the following problem using grep: Find all the computer science students in the first three years of study, belonging to odd numbered groups. The usernames of the computer science students … | |
Re: [QUOTE=outkast;1159461]Hi is there any way to run a shell script from a batch file? im new to this and any help is really appreciated. Thanks[/QUOTE] Depends on what you mean by shell script and batch file? Do you mean running bash script from a Windows batch file? | |
Re: what's a sptr sptr->key[i] = (i * 100 + 13579); You don't have anything defined as a sptr...ptr yes but not sptr.. Plus your treating key like an array by using the [] but you have key defined as a structure member [CODE] struct hash_tbl { int key;/*note not an … | |
Re: [QUOTE=keithodulaigh;1163165]Hi, I was looking at this tutorial: [URL="http://linuxgazette.net/77/krishnakumar.html"]http://linuxgazette.net/77/krishnakumar.html[/URL] There's an instruction there that says "seg es", my question is whats this instruction in AT&T style? I'm trying to rewrite the code in AT&T syntax and use it with gcc/ld but it gives me an error: "kernel.s:6: Error: no such instruction: … | |
Hi, I have a simple question about the Linux Shebang '#!'. Well more of a clarification of how Linux handles #!. My understanding.... When the operating system 'Linux' encounters an executable file with the first characters #! it will extract the absolute path for the executable from this line..i.e. #! … |
The End.