- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
- PC Specs
- Linux
Hello everyone! this is a code to reverse strings of a array of char ptr. I am passing the char* array, dynamically allocating memory to reverse and link with the char* array. The print it gives in the str_rev() are perfect. But when I print same thing in main(), it … |
|
Hello Everyone, I got this question in some book. As per question we need to find a substring in a array of char* and replace it with another string. The program I wrote doesn't work. I tried using strcpy as well char by char. Please help me to figure out … |
|
Hello, day's greet!! I was trying to pass a 3D array. But the following code generate error. Please tell me where am I wrong and why. Thanks a lot !!!! #include<stdio.h> void print_all(int [][][],int,int,int); int main() { int degree=3, row=2, col=3; int arr[3][2][3] = { {1,2,3, 4,5,6 }, {7,8,9, 10,11,12 … |
|
What is the maximum buffer size allowed in memecpy() function in c, I am using GCC compiler,32-bit system, What is the affecting factor for memcpy failure? ->Alignment issue? ->Size? however the buffer size 256bytes not working, tried 160 bytes copy which fits our requirement |
|
Hello, I want to duplicate a list in python. The way I want is, I need two list with same content pointing to different memory Location. What I tried is Dup_List = Original_List[:] , but lookes like even this is making both list point to same memory location. Both the … |
|
Hi, I have a device connected to the USB port of the laptop. This device pumps data to the port which is read by the python script. As per the baudrate of the board I use folowing configuration to open the port. Serial(options.port,921600,timeout=0.2,xonxoff=0,rtscts=1) But when I analyse the collected LOG … |
|
Hello, in this code snippet I am not able to understand line 8 and 10. Here at line 8, char* is getting typecasted as int* then again, getting typecasted as char*. Please explain. #include<stdio.h> int main() { int arr[3] = {2,3,4}; char *p; p = arr; p = (char*)((int*) (p)); … |
|
The output of this code is -1, 4, 4. I am not sure about this -1. Is it because when all bits are set then in decimal it means -1 ? #include<stdio.h> int main() { struct value { int bit1:1; int bit3:4; int bit4:4; }bit={1,4,4}; printf("%d %d %d",bit.bit1, bit.bit3, bit.bit4); … |
|
The output of this code is char *str="char *str=%c%s%c;main(){printf(str,34,str,34);}";main(){printf(str,34,str,34);} I don't know how this is happening. Please explain. #include<stdio.h> char *str = "char *str=%c%s%c;main(){printf(str,34,str,34);}"; int main() { printf(str,34,str,34); return 1; } |
|
Hello, I am not able to understand whats happening behind "ptr-p", "*ptr-arr". Please explain #include<stdio.h> int main() { static int arr[]={0,1,2,3,4}; int *p[]={arr,arr+1,arr+2,arr+3,arr+4}; int **ptr=p; ptr++; printf("\n %d %d %d \n",ptr-p,*ptr-arr,**ptr); *ptr++; printf("\n %d %d %d \n",ptr-p,*ptr-arr,**ptr); *++ptr; printf("\n %d %d %d \n",ptr-p,*ptr-arr,**ptr); ++*ptr; printf("\n %d %d %d \n",ptr-p,*ptr-arr,**ptr); return … |
|
In this code at line number 7, 'p' is a 1D pointer then how come at the print statement it is being considered as 2D pointer ? and when we do 'a+1' then it would cross whole array. I am not able to understand this code. Please explain. Expected output … |
|
The output of this snippet is 4 and 1. 4 is ok but why this 1 ???? #include<stdio.h> int main() { printf("%d %d",sizeof(NULL),sizeof("")); return 0; } |
|
Hello,I have written this script to telnet from Ubuntu system to windows7 running system. This script goes fine upto login name, then it takes the password but it is not able to process the password. Although it looks as if the password has reached other side but in real it … |
|
Hello, the output of this code is 'ef' but if we add up a "newline" print after this print then the output becomes 'efd'. Then why in earlier scenerio the 'd' was not getting printed ? Thanks in advance. #include<stdio.h> int main() { printf("\nab\bcd\ref"); } |
|
Hello, This code is from "Test Your C Skills" Book. In the book they have mentioned that this code won't work, and thats true. But I am not able to understand, why its not working. Please explain why it gives error. #include<stdio.h> #define SWAP(a,b,c) c t;t=a;a=b;b=t; int main() { float … |
|
Hello......I have written a script in which I am telnetting from system1 to system2. There from system2 I am doing ssh to system3. This system3 is a Embedded Board running Linux. Here on system3 I am executing a code that gives me a CLI interface. In this CLI we have … |
|
Hello, I need to write a python script for performing telnet between two windows machine, that is Host and Client. After doing Telnet Successfully I need to run some application on other machine and there in that application I need to give commands via my script aswell after giving command … |
|
Re:
I want to buy a printer with scanner and xerox please give me suggestion ............. |
|
Hi, this code is compiling successfully, but giving "segmentation fault" when I am trying to copy data to shared memory. Please tell me where I am wrong. Thanks a lot............ #include<stdio.h> #include<sys/ipc.h> #include<sys/shm.h> #include<sys/types.h> #include<unistd.h> #include<stdlib.h> #include<errno.h> #include<string.h> int main() { int id=-1, status=-1; char *check=NULL; char *p="you"; const size_t … |
|
Hi, can anyone please tell me how to create a array of 20 crore (200000000) elements. I tried, but getting runtime error, might be that much memory is not available. Thanks |
|
Re:
I have an interesting browser hijacker that randomly redirects me whenever I click a search link, and recently even if I paste a direct url into the address bar it will redirect. I've been away from this field for a bit and am a little rusty, but I have ran … |
|
Re:
#include <stdio.h> #include <float.h> float grosssalarycalc(float value1,float value2){ float gsalary; gsalary=value1+value2; return (gsalary); } float ovtmpayoutcalc(float value1){ float ovtmpayout; ovtmpayout=25*value1; return (ovtmpayout); } float netpayoutcalc(float value1){ float netsalary; netsalary=value1-(value1*0.20); return (netsalary); } int main() { char name[32]; float ovtmpayout0,gross,net,ovtmhrs,salary; printf("Payroll Calculation Program\n"); printf("Employee, please enter your name:\n"); scanf("%s", name); printf("Employee, … |
|
Re:
int x = 0; int i,j,p; int buf[4]; int *array[5] = {0}; for (j = 0; j < 3; j++){ for (i = 0; i <4; i++) { buf[i] = x++; } array[j] = buf; } int* temp; temp = array[1]; for (i = 0; i<4; i++) { printf("%d\n", *temp); … |
|
Re:
How to accept strings and print then them please explain me with example if possible Thanks in advance ............. |
|
Re:
I have this code: sigc::connection conns[4]; And I get this error: Program received signal SIGSEGV, Segmentation fault. 0x00f4b620 in g_type_check_instance_is_a () What does this mean? |
|
Re:
write a pseudo code of a program that prompts you to enter grades of 100 students .the possible grades A,B,C,D and F. The program should count the total number of each grade entred and then print them out |
|
Re:
i have put one FUNCTION (Display) in the code's but still not functional is there any way by which we can convert BCD to DEC code's and can be printed out as output I know its wrong please help me to make it right thanks [ the CODE's is for … |
|
This code is crashing, please tell me for what all I need to assign memory. Thanks #include<stdio.h> #include<conio.h> #include<stdlib.h> struct s1 { char *p1; }; struct s2 { struct s1 *p2; }; struct s3 { struct s2 *p3; }*p4=NULL; int main() { char a='a'; p4=malloc(sizeof(struct s3)); p4->p3->p2->p1=&a; printf("%c",*(p4->p3->p2->p1)); return 0; … |
|
The output is 2011. Can anyone plz tell me how it is so ????[CODE=c]#include<stdio.h> #include<conio.h> void main() { char c[]="GATE2011"; char *p=c; clrscr(); printf("%s",p+p[3]-p[1]); getch(); }[/CODE] |
|
The output of this code is "hhe!". Upto "hhe" I can figure out what is happening but, where does this "!" came from? ASCII value of "!" is 33 and here I don't think we are anyhow getting this value. Thanks in advance[CODE=c]#include<stdio.h> #include<conio.h> void main() { static char s[25]="The … |