If I have this struct:#include <stdlib.h>#include <stdio.h>#define KIDS 4typedef struct test {int x;int y;} container;I would now like to make an array containing 4 pointers to this struct. ButI would also like to allocate space for this array:int main(void){container *new[4];new=mal...
If I have this struct:typedef struct test{int x;int y;}container;Now I would like to make an array of 5 pointers to this struct:int main(void){container *cp[5];cp=malloc(sizeof(container));container->content="big";container->tt=malloc(sizeof(container *)*5); //THIS LINE GIVES ERRR!return 0...
06-02-2006I received this email and thought it was like all the rest of the get rich quick schemes. I thought what have I got to lose other than 5. I have read a lot of message board posts saying that this program doesnt work. Well the curiosity got the better of me and I did it. I have to this...
I'm curious if you can easily use qsort to sort the letters in a nullterminated string, without using any conditional statements?char str[ ] = "bdace";becomes "abcde"...
I have a file with different ways to write numbers 8< (cut)0: zero, zilch,, nada, ,,,, empty , void, oh1: one7: seven2: two, too >8 I wanted to read that file and put it into dynamic memory, likechar synonym;/* assume everything is already malloc'd */synonym[0][0] = "zero";synonym[0][...
Hello,I'm writing a little program which has to get a FQDN on his stdin andreturn the IP on stdout, we can do it easily with gethostbyname callbut I would like to set up a timeout to this blocking system call. SoI read texts about this and I planed to use a hack with alarm andsetjmp/longjmp...
Hi,I am have basic doubt in && operatorfor examplewhat happens when we manipulate negative value and postive value using'AND' operationvoid main()int j=-10,int k=11,c=0;c=j++ && k++;printf("j=%d\nk=%d\nc=%d\n",j,k,c);return 0;}output of the above program isj=-9k=12c=1when the program r...
I have this following code:x= tempStr.I((char)13, 0);The string tempSTR = "Heading"Notice that their is a Carriage Return and/or line feed before thestirng value of "heading?" What I was wanting to do with this code isfor the variable x to equal to location of the first carriagereturn/line feed/...
If you were to compile/run the code below, and get the result '30', I'd bevery interested to know what compiler you're using - and its optimisationsettings [esp. if it supports the 'restrict' keyword]#include <stdio.h>int test(int * a, int * b){*a = 5;*b = 6;r...
Hi,I want to print a string with defined width left trailed; How can I dothis?Example: Print ("%05d%3s", &test1, test2[i]);say test1 = 23test2[i] = HiIt prints like 1 2 3 4 5 6 7 80 0 0 2 3 H iBut I want like this:It prints like 1 2 3 4 5 6 7 80 0 0 2 3 H iHow can I do this?Thanks...
hello all,what is full name of operating system UNIX?...
In order to avoid declaring static variables in a function I was askedto write a scratch memory.Reserve a block of memory outside the function and assigning pointersto the memory locations as per convenience and access them.I was told this would save some memory. I dont understand the logicbehin...

