- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 9
- Posts with Upvotes
- 7
- Upvoting Members
- 7
- Downvotes Received
- 4
- Posts with Downvotes
- 4
- Downvoting Members
- 2
- Interests
- different kind of stuff
- PC Specs
- dell vostro v131, celeron 867, archlinux openbox
Re:
please give the program for sorting a linked list without affecting the original value |
|
Re:
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 … |
|
Re:
I have the following code: #include <iostream> #include <conio.h> using namespace std; long filesize(FILE *stream); int main(void) { FILE *stream; char c; int i=0,n; long lSize; stream = fopen("tanc.TXT", "r"); fseek (stream , 0 , SEEK_END); lSize = ftell (stream); rewind (stream); cout<<"Dati numarul de caractere:"; cin>>n; while(!feof(stream) && i<lSize) … |
|
Re:
Write a program that reads a file, breaks each line into words, strips whitespace and punctuation from the words, and converts them to lowercase please help me out . thanks in advance |
|
Re:
I'm trying to write a code to take an image as argv[1] and save it in a new file "argv[2]" with the image flipped upside down, but my output does not open with any image viewer here's my full code. some one help me out please #include <stdio.h> #include <string.h> … |
|
Re:
code snippet: void checkcollision() { float x1 = tanks[0].x; float y1 = tanks[0].y; float x2 = tanks[1].x; float y2 = tanks[1].y; float dist = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)); float dr = tanks[0].rad+tanks[1].rad; if(dist<dr); { printf("checkcollision read true\n"); printf("dist: %f, radius+radius: %f\n",dist,dr); goback(0); goback(1); } } output: checkcollision read true dist:363.159302, radius+radius:14.142136 … |
|
Re:
Ok. As the title says I tried many times to simply write a program that rewrites a file to remove null characters. I confirmed with a hex editor that the file in question has tons on null characters, on average about 1 of every 2 characters in null. So my … |
|
Re:
A piece of C code was creating core dump. When i simply added a few fprintf statement and printed the value of variales used in code to a file, surprisingly the code ran successfully. I tried the scenario number of times and the result was same "when fprintf was present … |
|
Re:
I'm trying to make a C program to run DOS commands but I keep getting "illegal command" error. Here's the code. #include<stdio.h> #include<process.h> int main() { system("ipconfig/all"); return 0; } |
|
Re:
Develop a program to meet the following requirements: 1. Must use at least two functions, not including Main 2. Must use indirection (the * operator) 3. Must use a loop 4. Must use an array to hold the integers 5. Must take the integer inputs from a file Your assignment … |
|
Re:
#include <stdio.h> main() { FILE*fp ; if ((fp = fopen("new.txt","r")) == NULL); { printf("file could not be opened\n"); return 0; } } this is what ive written and it always comes back with file could not be opened. I need to read the text file new, which has 10 variables … |
|
Re:
i have the log file with byte dump and also structures.. using byte data as input i need to print the values of structures in user readable format..can anyone post the code.. here is txt file.. 002c2a54:00000000 00001389 11950000 00000000 00000000 00002b74 0000011c 00000000 002c2a74:01010100 01000000 0e600384 00000000 00000384 00000000 … |
|
Re:
#include <stdio.h> #include <stdlib.h> struct rithish { int roll; char name; }*s[20]; void main() { struct rithish *s; int i; for(i=0;i<2;i++) { printf("\n\n\t Enter roll : "); scanf("%d",&*s[i].roll); printf("\n\n\t enter name: "); scanf("%s",&*s[i].name); } } is it possible to do structure variable as pointer to array |
|
Re:
#how to parse log files using structures or enum# |
|
Re:
I have to display the message only for a specific time. After that it should be erased from the display. how to do this program in c. |
|
Re:
if we print a float using %d garbage value is printed....but if we scan a float value using %d & int...the value gets truncated...What is the reason behind it... |
|
Re:
#include <stdio.h> #include <stdlib.h> main() { char a[30]; int i,j,n,temp; printf("enter the limit: "); scanf("%d",n); printf("enter the string: "); for(i=0;i<n;i++) { scanf("%s",a[i]); } for(i=0;i<n-1;i++) { for(j=i+1;j<n;j++) { if(strlen(a[i])>strlen(a[j])) { temp=a[j]; a[i]=a[j]; a[j]=a[i]; } } } for(i=0;i<n;i++) { printf("%d",a[i]); } } compiler stops working here when executing the program but 0 … |
|
Re:
char str[]="S\065AB"; printf("\n%d", sizeof(str)); explain the output. i am getting 5. |
|
Re:
1) Write a program to make commandline calculator ? Format like that : excutablefile firstoperand opertator secondoperand Ex : ./a.out 1 + 3 result : 5 |
|
Re:
#include <stdio.h> #include <stdlib.h> void main() { char str[10],str1[10],str2[20]; int i,j,k; printf("enter string1: "); gets(str1); printf("enter the string 2: "); gets(str2); for(i=0,j=0;str1[i]!='\0';i++,j++) str[j]=str[i]; for(i=0,k=j;str2[i]!='\0';i++,k++) str[k]=str2[i]; printf("%s",str); } not producing correct output |
|
|
Re:
hi.... int x=30, *y,*z; y=&x; assume x address is 500 and int is of 4 bytes z=y; *y++=*z++; x++; printf("%d %d %d",x,y,z); i want to ask that how the value of y is 504 here ? firstly value of z is assigned to value of y. then z is incremented … |
Re:
Why the program is running without line 14? #include<stdio.h> #include<iostream> //#include<conio.h> //#include<math.h> #define FOR(i,a,b) for(int i=a;i<b;i++) using namespace std; int main() { int a[]={1,2,3,4,5,6,7,8,9,10}; int *b; //b=(int *) malloc(sizeof(a)); b=a; //cout<<b; FOR(i,0,10) cout<<b[i]<<" "; //cout<<sizeof(b); //getch(); return 0; } |
|
|
Re:
hello, I am learning C from past 1 year, Now, I want to improve my coding skills by learning techniques like dynamic programming, backtracking and all that stuff. Can u please tell me or give me links from where i can learn, practise and improve these skills ? please help … |
Re:
need help for this question Calculate the biggest of four integers. The user inputs four integers. Your program will determine the biggest of these four numbers and print out an appropriate message, specifying this biggest value. You are required to implement and use the following functions for this task: int … |
|
Re:
First, i'm new to C and trying to teach it to myself so be gentle. All i'm trying to do is malloc a block of memory so that i can store a few strings. These strings are to be pointed at by an array of pointers so that as i … |
|
Re:
hey starting data structers through pointers , i don't know how to reverse a singly linklist? pls help |
|
Re:
I made the following functions for deleting a node of a singly linked list. 1. Can these functions be improved furthur? 2. Is it necessary to free the memory of the node that is deleted? nodep deleteByValue(nodep p, int value) { nodep temp = p; if(temp->data == value) return temp->next; … |
|
Re:
Hi, I am running Ubuntu 12 on Virtual box and I am using GCC to compile this simple C program that has simple OpenMp pragmas : #include <stdio.h> #include <omp.h> #define MAX 10000000000 void main() { unsigned long long i,j,k,l; int threadnumber; #pragma omp parallel shared(i,j,k,l) { threadnumber = omp_get_thread_num(); … |
|
Re:
Hey there, I'm having issues with a custom string tokenizer I'm using for an assignment. I've looked around and haven't managed to find anything that really answers my question, so here goes nothing. Whenever I run the program and it runs the tokenizer, I get a seg fault. I'm fairly … |
|
Re:
hello friends, i have some problem with the concept of singly link list,,, don't know how to read it backward pls help |