17 Posted Topics
Re: This code snippet is from stanford library. It's elegant and simple. Some parts get tricky, it's better to have a drawing to understand it better. void RecursiveReverse(struct node** headRef) { struct node* first; struct node* rest; if (*headRef == NULL) return; // empty list base case first = *headRef; // … | |
Re: I guess this should help. #include <stdio.h> #include<string.h> struct student { int* ptr[23]; char* name[12];//store address of character string }s1; int main(void) { int roll=20; s1.ptr[0]=&roll; s1.name[0]="zahid ali"; printf("roll no of student :%d\n",*(s1.ptr[0])); printf("name of student:%s\n",s1.name[0]); return 0; } | |
Re: The problem is with the argument passing methods. Before the discussing the solution to this issue, we shall see the concepts a bit. There are two types of passing arguments to the function. * Pass by Value * Pass by Reference In the pass by value, only the values are … | |
Re: In case you are using GNU Linux use **time** command in the shell. This utility will give the time taken from the invocation to the end of the program. The output will be something like this $time a.out real 0m0.255s user 0m0.130s sys 0m0.030s | |
Re: They both are same functionally eventhough the syntax is different. The compiler decay's **function(int x[])** into **function(int *x)** When you are passing an array to a function, you are implicity passing the address of it invariably. There is no pass by value when it comes to a function with array … | |
Re: Yes, it is possible but it is not recommended. Consider the following program. #include <stdio.h> int main() { int n=10; int i; int a[n]; for (i=0;i<10;i++) { a[i]=i; } printf ("%d", a[5]); return 0; } It will produce the desired result which is 5. NOTE: The value of n should … | |
Re: Do a cat of /proc/cpuinfo. If you could see "lm" in the flags, then your CPU is 64 bit. lm stands for long mode. | |
Re: > id=shmget(111,ps*3,IPC_CREAT|06666); I haven't used this flag 06666 before, but when i tried with 666 option it worked. Unless otherwise you have special purpose using this flag you can switch to this ubiquitous mode (0666). > if(id<0 && errno !=EEXIST) This condition will only pass when the id is -1 … | |
Re: I guess the shared library symbol table is getting loaded. Try the below command in gdb, before running the program. ***show auto-solib-add*** -- this will indicate the current status. Incase if this mode is ON, turn it OFF using the command **set auto-solib-add mode off** Hope it helps :) | |
Re: I guess you might be interested in "**getopt**" API provided by Linux. It allows to get reterive various options from command line. See the man page for more info. | |
Re: The argument to the function log is just "log-$date.log". So only that will go to the log file. Try "ls -l (SOURCE DIRECTORY)" as the argument to the log function. NOTE: Use the -r option to append the files into the tar archive. Using -c option will create new archive … | |
Re: viplovdeep: If you are able to connect with LAN but unable to ping to Interent, then there might be a problem with the DNS. (It needs to resolve the IP with the Hostname) Check whether you have the same DNS Server IP in laptop and PC. Else use the OpenDNS. … | |
Re: This [link](http://www8.cs.umu.se/~isak/snippets/strrev.c) should help. | |
Hi, I searched the net about this question and could figure out exactly the answer to this. They say that CIDR will probably increase the efficiency of the router. If someone could enlighten me on this, it would be a great help to me. | |
I tried the first post on wxpython by fuse. The code is as follows # import wx # # always add this line, or your code won't compile - the wx module contains the GUI code you'll use # """The start of our wxPython GUI tutorial""" # # app = … | |
Hi, I am trying to build a rectangle which changes its size with respect to the input given. My problem is that on using the[B] surface.blit[/B] function the object start to replicate when the size of the screen is greater than the object. So many rectangle appear instead of one. … | |
Hi, I am new to programming with python. I want to make a image rotate dynamically corresponding to the CPU usage in ubuntu. I searched everywhere but couldnot find any post for it.All i have found is a static rotation with the PIL. If anyone could help me in this … |
The End.