1,494 Posted Topics

Member Avatar for serra01

[QUOTE] Pointer topic and the use of it totally useless. [/QUOTE] If this were true then every program would cease to run...Maybe I misunderstood your posting...

Member Avatar for WaltP
-5
73
Member Avatar for sree_ec

[QUOTE=sree_ec;1091228]Thank you.. could you please explain the reason also in detail...[/QUOTE] If you want to see the reasoning, try verifying the addresses that your passing. start with the original address, then verify it in the first function and then verify that its the same in the second function.

Member Avatar for Narue
1
343
Member Avatar for astropirate
Member Avatar for Iam3R

[QUOTE=Iam3R;1089673] the things i dont undestand here is : 1) why the command nm Lib_Symb.o and Main_Symb.o are not having any address refereence, all address are zero there. 2) is there any relation between addresses in the command nm a.out because there are different things that are specifeid at some …

Member Avatar for Iam3R
0
165
Member Avatar for john butler

[QUOTE=john butler;1091791]Basically what is the system level difference between language C and C++ ?[/QUOTE] Could you give us an example of what you mean by system level.

Member Avatar for Narue
0
159
Member Avatar for Crushyerbones

[QUOTE=Crushyerbones;998096]Hello guys, I'm trying to make this work [CODE]all: daemon client daemon: cd ./daemon; make daemon client: echo going in cd ./client; make client clean: cd ./daemon ; make clean cd ./client ; make clean[/CODE] But I'm having 2 problems: 1) Make ALWAYS tells me there's nothing to be done. …

Member Avatar for Crushyerbones
0
136
Member Avatar for cthoes
Member Avatar for gerard4143
0
271
Member Avatar for gerard4143

One day while pondering about C I came up with this program. Can you predict what the answer will be? Now run it, were you right? filename.c [CODE] #include <stdio.h> #include <stdlib.h> int main(int argc, char**argv) { unsigned long *iptr = (unsigned long*)0;/*pointer equals 0*/ unsigned long ans = (unsigned …

Member Avatar for gerard4143
0
142
Member Avatar for leegeorg07

Here's a little blurb from Linux's 'man make' [QUOTE] 6.9 Variables from the Environment ================================== Variables in `make' can come from the environment in which `make' is run. Every environment variable that `make' sees when it starts up is transformed into a `make' variable with the same name and value. …

Member Avatar for vegaseat
0
103
Member Avatar for msr

[QUOTE=msr;1065524]Hello, Im using threads in a recent project. I would like to know whats the difference between: pthread_kill() and pthread_cancel() What are the effects of each one? Thank you![/QUOTE] If your using Linux/Unix try open a terminal and type man pthread_kill man pthread_cancel and it will retrieve all the info …

Member Avatar for Vijikumar
0
2K
Member Avatar for daudiam

I hope this link will straighten you out: [url]http://en.wikipedia.org/wiki/End-of-file[/url]

Member Avatar for Narue
0
141
Member Avatar for sunshine24

I modified your code somewhat so you can see what's going on... 1. Run the code below, what values did you get for A, B, C, D, E ? 2. Now un comment the fgetc(stdin) lines and run the code again what are the values now This should tell you …

Member Avatar for sunshine24
0
163
Member Avatar for johndoe444

Try googling freopen()...plus here's a small example of redirecting stderr to a file named output. [CODE] #include <stdio.h> #include <stdlib.h> int main(int argc, char**argv) { freopen("output", "w", stderr); fputs("send this to stderr\n", stderr); exit(EXIT_SUCCESS); } [/CODE]

Member Avatar for WaltP
0
79
Member Avatar for regist1

Check out this link: [url]http://www.onlineconversion.com/roman_numerals_advanced.htm[/url]

Member Avatar for tux4life
-1
211
Member Avatar for anatz

[QUOTE=anatz;1088825]hi,.im a first year student taking information technology, never mind where i am studying.,,,i just want to ask some tips to understand easily turbo c.,.[/QUOTE] 'Easily understand C' is probably a misnomer but if you have any questions about one of the best programming languages 'C' then fire away...

Member Avatar for gerard4143
0
76
Member Avatar for moomeen

[QUOTE] how can i read each number and define it as an integer ???? [/QUOTE] Try googling strtol, strtoll, strtoq - convert a string to a long integer

Member Avatar for mrnutty
0
82
Member Avatar for maqsood8797

[QUOTE] Rules: • Please solve it on your own/submit your own solution. [/QUOTE] What don't you understand about the above rule?

Member Avatar for ShortYute
-4
153
Member Avatar for marirs07

[QUOTE=marirs07;1088520]is it possible in c program to run two processes at the same time.For example i want to run a timer along with my application .The timer must be shown on the screen.Thanks in advance[/QUOTE] The short answers is yes with clarification as to what you mean by "same time". …

Member Avatar for gerard4143
0
90
Member Avatar for jp071

[QUOTE=jp071;1087438]I am still in problem. i could not solve the segmentation fault. could anybody know me in more details?[/QUOTE] Could you post your updated code..So we can see what you changed.

Member Avatar for jp071
0
251
Member Avatar for matthewl

[QUOTE=matthewl;1087396]Lets say I have two functions that I want to run simultaneously for different purposes as example a function handles an XML RPC requests and the other function handles an IRC connection to an IRCD. what my goal would be to avoid program hang ups on user requests. Is pthreads …

Member Avatar for gerard4143
0
112
Member Avatar for nigelmercier

[QUOTE=nigelmercier;1087328]Hi guys, I'm pretty much a C newbie, but I've dabbled in other languages over the years. For my current project I'm using mikroElektronica Pro C on a PIC microcontroller. I've got a 2-dimensional array defined like this: [CODE]const char FONTTABLE[96][5]= { {0x00,0x00,0x00,0x00,0x00}, {0x00,0x00,0x5f,0x00,0x00}, {0x00,0x07,0x00,0x07,0x00}, /** [90 rows snipped] **/ …

Member Avatar for gerard4143
0
143
Member Avatar for kde

I read this posting a few times and I'm at a loss..Do you mean if you have a number say: unsigned int myint = 87456; do you want to extract from it 8 - 7 - 4 - 5 - 6?

Member Avatar for gerard4143
0
104
Member Avatar for shadwickman

[QUOTE=shadwickman;1086857] So would some compilers know that only freeing the list should free all its indices, or would I always get a memory leak with that? Either way, I want to know if there's an ANSI standard on this... which is probably the second method here if anything. Thanks in …

Member Avatar for shadwickman
0
126
Member Avatar for Iam3R

check out this link: [url]http://en.wikipedia.org/wiki/Sizeof[/url]

Member Avatar for Narue
0
104
Member Avatar for dennis.d.elston

Number one its assignment to a structure and you have some major problems with your code...I'm looking at it right now.

Member Avatar for dennis.d.elston
0
111
Member Avatar for MAV_DevWantaB

Look at how I displayed the binary number...its much easier to read, besides that the code code looks O.K. [CODE] #include <stdio.h> #include <stdlib.h> #include <math.h> int reversebits( unsigned int n ); /* prototype */ int reversebits(unsigned int n) { unsigned int temp = n; int i; for(i = (sizeof(n) …

Member Avatar for MAV_DevWantaB
0
219
Member Avatar for spookytr

Added a few things [CODE] #include <stdio.h> #include <stdlib.h> int arrayToplam (int *a, int size ); int main() { int i, j = 0; int *x = (int*)NULL; printf(" Kac Sayi Toplamak Istiyorsunuz: "); scanf("%d",&i); x = malloc(sizeof(int)*i); if (!x) { fputs("could not allocate memory!\n", stderr); exit(EXIT_FAILURE); } for (j …

Member Avatar for spookytr
0
115
Member Avatar for cthoes

Right away you shouldn't use: [CODE] char name[20]; scanf("%s",&name); [/CODE] It should be: [CODE] char name[20]; scanf("%s",name); [/CODE] Wasn't this just posted? Also main should return a value.

Member Avatar for cthoes
0
101
Member Avatar for johndoe444

[QUOTE=johndoe444;1082122]hi, [CODE]#include <stdio.h> int* get_int() { int arr[100]; arr[0] = 5; printf("arr %p\n",arr); return arr; } int main() { int* p = get_int(); printf("got %p\n",p); return 0; }[/CODE] for the code above I get this warning message: [CODE]test-heap.c: In function ‘int* get_int()’: test-heap.c:5: warning: address of local variable ‘arr’ returned …

Member Avatar for gerard4143
0
265
Member Avatar for johndoe444

Number one, your trim function doesn't return anything...so if I had to guess str is getting whatever is in the eax/rax register.. [CODE] str = trim(str); [/CODE]

Member Avatar for johndoe444
0
93
Member Avatar for BestJewSinceJC

[QUOTE](If this even works, which I'll test in a second[/QUOTE] You posted this without even showing the ambition to try it first?

Member Avatar for WaltP
0
94
Member Avatar for johndoe444

[QUOTE=johndoe444;1082056]Hi, I want to write a log function but I want to implement in the style of fprintf/sprintf style. ie [CODE] fprintf(arg1, template string, template values) write_to_log(template string, some array of ints/double etc to fill the template) [/CODE] I want to implement this variadic function: [CODE] void write_to_log(char template, int …

Member Avatar for Dave Sinkula
0
114
Member Avatar for johndoe444
Member Avatar for nezachem
0
254
Member Avatar for johndoe444

[QUOTE=johndoe444;1081281]Hi, In java, we can run a program remotely by doing something like this: [CODE]Runtime.exec("ssh machinename programname")[/CODE] I was wondering whether I can do the same in C using some standard library function call. Also is this possible to get a handle to the remote program's input/output to see its …

Member Avatar for gerard4143
0
95
Member Avatar for Hitman Mania

try running this code...you'll be able to see your output which I cropped at 100 [CODE] #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int a, c; a=3; c=2; for (c=2; c<100; c++) { for (a=3; a != a%c; a++) { printf ("%d \n", a); if (a > …

Member Avatar for gerard4143
0
80
Member Avatar for redroze

[QUOTE=redroze;1076726]hello folks, I have an array of integers and I need to search if there's a combination of 2 numbers that resault a defined sum. No loops or static variable are allowed. Any suggestions? cheers, Elad.[/QUOTE] You could try recursion.

Member Avatar for uskok
0
153
Member Avatar for kemiko

I'm not sure what program was run to get that output but info binutils will list all the binary utilities that are available in Linux. Maybe if you gave us a little more to go on....What are we looking at?

Member Avatar for gerard4143
0
251
Member Avatar for onesreality
Member Avatar for Iam3R

Just curious, If you run this program what's your outcome [CODE] #include <stdlib.h> #include <stdio.h> #define ARR_SIZE 10 int main() { int i = 0; unsigned long *myint = NULL; myint = (unsigned long*)malloc(ARR_SIZE * sizeof(unsigned long)); for (i = 0; i < ARR_SIZE; ++i) { fprintf(stdout, "addr->%p\n", (void*)myint++); } …

Member Avatar for Dave Sinkula
0
103
Member Avatar for miskeen

This may not be 100% but I always though of global and external variables as indicators to the linker such that: global variable is available out side of the file its defined in. external variable is defined out side of the file its used in.

Member Avatar for gerard4143
0
931
Member Avatar for Iam3R

Memory is aligned on word size. This is done for efficiency reasons, You really should continue exploring memory and how its laid out, its an interesting subject - may I suggest you look into packed structures..

Member Avatar for gerard4143
0
144
Member Avatar for dennis.d.elston

Number one, I have to ask, how strict is your definition of palindrome? Would you consider this one - Madam, I'm Adam Where punctuation, case and spaces are ignored.

Member Avatar for mrnutty
0
126
Member Avatar for Hitman Mania

Please read this: [url]http://www.daniweb.com/forums/announcement118-2.html[/url] If your looking for the answer without any effort try googling

Member Avatar for gerard4143
-1
99
Member Avatar for basakua

I would use two for loops - one counts down from the number of asterisk and then another that counts up to the number of asterisk.

Member Avatar for gerard4143
0
103
Member Avatar for Nogat21

Quick question, how are you passing your char pointers? From what I can see your passing the pointer value and not the characters that make up the character array. The pointer values from the client application have no valid meaning in your server application.

Member Avatar for gerard4143
0
207
Member Avatar for rehaam

[QUOTE=rehaam;1077113]Hi I need help;; Write a program to simulate a demand paging system. The program should implement the FIFO and LRU page replacement algorithms presented in Chapter 10 of the textbook. Your program input should include: The name of the page replacement algorithm. Information about the number of physical page …

Member Avatar for gerard4143
0
2K
Member Avatar for Placinta

Here's an example of passing/allocating a pointer in a function [CODE] #include <stdio.h> #include <stdlib.h> void Test(char **cptr); int main() { char *str; Test(&str); fputs(str, stdout); free(str); return(0); } void Test(char **cptr) { int val = 0; printf("How many characters do you want to enter->"); scanf("%d", &val); getc(stdin); *cptr = …

Member Avatar for Placinta
0
138
Member Avatar for raghuhr84

I tried this in Mandriva and it worked [CODE] #include <stdio.h> int main() { char str1[100]; char str2[100]; printf("Enter 1st string\n"); scanf("%[^\n]s",&str1); fgetc(stdin); printf("Enter 2nd string\n"); scanf("%[^\n]s",&str2); printf("1st string is %s\n", str1); printf("2nd string is %s\n", str2); return 0; } [/CODE]

Member Avatar for Dave Sinkula
1
688
Member Avatar for fenerista

[QUOTE=fenerista;1075308]I want to make a module that print console, current folder name like pwd, but I don't know how with system calls ? or something else ? if system calls, what is the system call of that ? and how can I use this system call on my module.?[/QUOTE] I'm …

Member Avatar for fenerista
0
274
Member Avatar for Iam3R

The first example your trying to change a const string - char *ptr = "String"; with the line *str ='T';(Note I assumed str is a typo and should be ptr) which is not allowed and for the "Hello, World" try: printf("%s%s","Hello", "World");

Member Avatar for Iam3R
0
122

The End.