1,494 Posted Topics

Member Avatar for paradiseis

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 …

Member Avatar for jephthah
0
566
Member Avatar for sharathk60

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...

Member Avatar for Ancient Dragon
0
140
Member Avatar for tomkaczocha

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.

Member Avatar for tomkaczocha
0
107
Member Avatar for tomkaczocha
Member Avatar for tomkaczocha
0
571
Member Avatar for daveoffy

[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 …

Member Avatar for daveoffy
0
265
Member Avatar for RexxX

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 …

Member Avatar for WaltP
0
184
Member Avatar for MVB

Is this a C or Cpp progect? If its a C project try including the string.h header.

Member Avatar for Salem
0
425
Member Avatar for prettyann

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 …

Member Avatar for jephthah
1
146
Member Avatar for prade

[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 …

Member Avatar for gerard4143
0
167
Member Avatar for johndoe444

[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 …

Member Avatar for johndoe444
0
125
Member Avatar for jephthah

Did you try investigating setjmp, longjmp. Also sometimes, for efficiency, goto's are the best solution.

Member Avatar for nezachem
0
136
Member Avatar for johndoe444

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.

Member Avatar for Aia
0
162
Member Avatar for johndoe444
Member Avatar for serious01

I tried googling 'C programming exercises' and got a page full of results.

Member Avatar for jephthah
0
98
Member Avatar for AngusFloydKAOS

[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 …

Member Avatar for nezachem
0
110
Member Avatar for wycliffe

Try googling bash tcp [url]http://thesmithfam.org/blog/2006/05/23/bash-socket-programming-with-devtcp-2/[/url]

Member Avatar for gerard4143
0
44
Member Avatar for tuffenuff
Member Avatar for johndoe444
Member Avatar for meisterluv
Member Avatar for gerard4143
0
245
Member Avatar for ryanleslie
Member Avatar for jonsca
0
98
Member Avatar for VernonDozier

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]

Member Avatar for VernonDozier
0
7K
Member Avatar for Chris_Giarla

[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 …

Member Avatar for gerard4143
0
161
Member Avatar for tyliang
Member Avatar for johndoe444

You should take a look at this link, You'll find manpages has 8 sections [url]http://linuxmanpages.com/[/url]

Member Avatar for gerard4143
0
103
Member Avatar for nupurashi

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 …

Member Avatar for WaltP
0
101
Member Avatar for junezy4

We provide help, or answers to specific questions..So what have you tried so far? What is your specific question?

Member Avatar for targ2002
-3
145
Member Avatar for junezy4

[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]

Member Avatar for Ancient Dragon
-6
170
Member Avatar for Soileau
Member Avatar for gerard4143
0
1K
Member Avatar for bulgin

[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 …

Member Avatar for gerard4143
0
34
Member Avatar for johndoe444

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]

Member Avatar for cfajohnson
0
107
Member Avatar for bohongtw

[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 …

Member Avatar for Aia
0
174
Member Avatar for oggiemc

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]

Member Avatar for oggiemc
0
125
Member Avatar for alcx88

[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?

Member Avatar for jephthah
0
2K
Member Avatar for southtucky

[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 …

Member Avatar for NotNull
0
154
Member Avatar for Iam3R

[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..

Member Avatar for Banfa
0
147
Member Avatar for alcx88

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]

Member Avatar for alcx88
0
250
Member Avatar for lionaneesh

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 …

Member Avatar for Ancient Dragon
-1
163
Member Avatar for abhay_tanu
Member Avatar for abhay_tanu
0
237
Member Avatar for lionaneesh

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]); …

Member Avatar for jephthah
-1
209
Member Avatar for shetnok13

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?

Member Avatar for Aia
0
179
Member Avatar for scourge.hellion

[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 …

Member Avatar for gerard4143
0
92
Member Avatar for Freespider

Try this link: [url]http://caml.inria.fr/pub/docs/old-311/libref/Scanf.html[/url]

Member Avatar for WaltP
0
131
Member Avatar for TimCereja

If this is a Linux/Unix program then you have to compile with -lcurses gcc filename.c -o filename -lcurses

Member Avatar for Ancient Dragon
0
93
Member Avatar for fatalblade

[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 …

Member Avatar for fatalblade
0
95
Member Avatar for W4W

[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] …

Member Avatar for gerard4143
0
81
Member Avatar for boogahubba

[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 …

Member Avatar for gerard4143
0
112
Member Avatar for outkast

[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?

Member Avatar for issue9
0
176
Member Avatar for kxh29

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 …

Member Avatar for kxh29
0
250
Member Avatar for keithodulaigh

[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: …

Member Avatar for keithodulaigh
0
144
Member Avatar for gerard4143

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. #! …

Member Avatar for gerard4143
0
330

The End.