15,550 Topics

Member Avatar for
Member Avatar for symmet

Hi, I'm trying to create a simple shell in C for Unix. I've been able to do all the parsing of commands and execution, but I'm having a problem with piping. I think the problem is that I'm not hooking into the correct pipe for the input of the second …

Member Avatar for gerard4143
0
176
Member Avatar for gerard4143

Is this the proper way to zero the first 12 bits of an address? [CODE] void *ans = (void*)((unsigned long)addr & ((0UL - 1) ^ 0xfff)); [/CODE] Where addr is any user process memory address.. Note this method works...I just want to know if there is a better way

Member Avatar for Dave Sinkula
0
159
Member Avatar for Kombat

Ok so I make my masks [CODE] short m1, m2, m3, m4; m1 = 0xF000; m2 = 0x0F00; m2 = 0x00F0; m3 = 0x000F; [/CODE] and then I test my masks [CODE]printf("%hd %hd %hd %hd\n", m1, m2, m3, m4);[/CODE] when I test it the values come out as [CODE]-4096 240 …

Member Avatar for Dave Sinkula
0
136
Member Avatar for imolorhe

Please, I need help in this little problem of printing all the prime numbers from to 100. Please, if you have more than one method to the question, I would really appreciate it. I also need it as soon as possible. Thanks.

Member Avatar for Chilton
-3
162
Member Avatar for vivek01anand

hii i want c code for non preemptive scheduler where burst time and arrival time is given and u have to return waiting time from the function u will develop. please give code soon pleaseeeee..

Member Avatar for Chilton
0
104
Member Avatar for chunalt787

I am new to message queues and IPC in general. I am trying to have a process establish the queue and send a message. Then I fork and the child will read the message. The goal is to measure the execution time for different sized messages. The msgsnd is returning …

0
97
Member Avatar for s.p.i.

Hi there guys, So I have two arrays, and each arrays got 5 elements (integers). My goal is to to arrange the elements of each of those arrays in a descending order and save them in a new array. I started off with bubble sorting each of those arrays and …

Member Avatar for s.p.i.
0
135
Member Avatar for shakunni

Hey, How do you read from the command line in C? I need to read 10 arguments from the command line. Can I use char* argv[] as a parameter in the main function to do so? Thanks.

Member Avatar for thines01
0
154
Member Avatar for needhelpe

I made a program that inputs the radius of a circle, and then should output a circle of asterisks. however, I am just getting the fourth-quadrant part of the circle, and I need the whole circle to be printout. what do I need in my code? this is my code: …

0
85
Member Avatar for Tamaki

Hi, I'm new here and I just need a little help with pointers and 2D arrays. I'm kind of new to programming so this might be redundant. I'm trying to make a 2D array of pointers (already have done) that points to another 2D array of double values... I have …

Member Avatar for Tamaki
0
167
Member Avatar for Iam3R

please provide the free pdf link of k & R c prog lang. i spent lot of time in googling but couldnot get it. thanks in adv.

Member Avatar for Tom Gunn
-4
134
Member Avatar for cwarren13

So, I have a server process that forks for every client that connects. I keep a list of connected clients that I want each fork process to have. Of course, when the process forks the child only has what it had when the fork occurred. For the solution to this, …

Member Avatar for venomxxl
0
2K
Member Avatar for himabindu

sir, we want complete c programme for huffman encoding & decoding.im doing my b.tech project .please send me the code

Member Avatar for ck.ckravi
0
254
Member Avatar for thebluestar

[CODE] #include<stdio.h> #include<conio.h> #include<string.h> int n; char (*p)[40],*temp; void Input(); void ABCsorting(); void Input() { printf("How many persons u want to input: "); scanf("%d",&n); p=(char*)malloc(n*40*sizeof(char)); temp=(char*)malloc(n*sizeof(char)); int i; for(i=0; i<n ; i++) { printf("String %d: ",i+1); fflush(stdin); gets(p[i]); } printf("All strings before sorting: \n"); /*for(i=0; i<n ; i++) { printf(" …

Member Avatar for Ancient Dragon
0
158
Member Avatar for Yee

Hi! I have had to change from Python to C because of university instructions. My problem is that, when I want to make a menu for my program or whatever, I always want to define classes:P My question is simple --> are structures the best way to "replace" classes? TY

Member Avatar for gerard4143
0
100
Member Avatar for thebluestar

I'm not sure about the difference between *p[5] and (*p)[5]? Please help me clarify them? Thanks a lot!

Member Avatar for Iam3R
0
159
Member Avatar for s.p.i.

Hi there, I was trying to code a simple program that bubble sorts an array into a list of numbers arranged in a descending order: Here is the code I used: [CODE=c] #define size1 5 #define size2 5 #include <stdio.h> int main() { int a[size1]={8,4,5,2,3};//array 1 int i=0; int n=0; …

Member Avatar for dkalita
0
94
Member Avatar for Iam3R

Dont know these types of questions are asked here or not but if any one has idea please help me. i just started started learning system programming and want to pursue a career in the sys prog area. below is the program that use a fork() call. i read in …

Member Avatar for dkalita
0
119
Member Avatar for godsgift2dagame

Hey guys, I've got an issue with the bowling program I've created. It's outputting the wrong scores, but I believe it's because of wrong bowling code. Is there anything wrong that you can see? One of the issues I'm having is frame 2, where the scores were 9 and 1, …

Member Avatar for dkalita
0
82
Member Avatar for spatel14

How do I generate random numbers in C? The user doesn't enter anything, I'm just looking for a way to generate random numbers every time I run the program. Thanks guys!

Member Avatar for Chilton
0
131
Member Avatar for rohanvijay

1. Write a C program to convert a given infix expression to postfix form using stacks 2. Write a C program to evaluate the postfix expression using stacks

Member Avatar for Chilton
0
172
Member Avatar for MajesticMoose

I need a function that returns the name of a key directly from the keyboard, eg, the input of '32' would return 'Space'. I know there is a function that does this, but I can't figure out which one.

Member Avatar for gerard4143
0
139
Member Avatar for PBIRBAS

Hi to all, Could someone show me by giving a code about how to create dynamic an Array in C, (nxm) from strings and read values in this array ? Thanks in advance...

Member Avatar for William Hemsworth
-1
86
Member Avatar for PBIRBAS

The following problem has to do with Arrays. I would appreciate if someone could give an explanation in this assumption below: If we assume that SIZE is a catholic constant with value 100 and A is Array of size SIZE with n stored elements from left to right. If it …

Member Avatar for kolosick.m188
0
83
Member Avatar for group256

Hey everyone, For my project, I need to write an assembly/C code to detect multiprocessors. I really have no idea how as I have barely done assembly coding and I have no good reference or even idea how to start. Again, what I am going to do is, I'm trying …

0
93
Member Avatar for Grn Xtrm

Hello friends, I am having a problem writing a function to search for a string in an input file. I have successfully output the file with line numbers, which was the first step in the program, but now I am stuck on searching for a given string. After searching for …

Member Avatar for Tajon Wong
0
3K
Member Avatar for msbhatt_2000

I want to solution for following question b'case i am begineer 1 Following is the menu to be displayed to the user. On selecting a choice display appropriate result. Number should be accepted from the user. Menu 1. Prime Factors 2. Leap Year 3. Sum of all digits 4. Number …

Member Avatar for ankush.sheetal
-1
179
Member Avatar for hangman1060

The programming assignment is to read a text file, extract the words from it, and save them in a 2D array that contains the word and the number of occurrences of that word. For example, if a text file contains the words "first" "second" "third" "second", the array should contain …

Member Avatar for imolorhe
0
123
Member Avatar for Soileau

I am trying to implement my own atoi function, and I am supposed to pass my variables in after ./a.out. Here is my code: #include <stdio.h> #include <stdlib.h> int myatoi(char array[]) { int sum = 0; int i = 0; while(array[i] != '\0') { int number = array[i] - '0'; …

Member Avatar for lipun4u
-1
222
Member Avatar for Bheeman89

Hello guys....I just have some doubt about C programming...well I have done a lot of functions for airline booking system but im not able to implement the multi dimensional array... I dont get how should I implement it in this problem as the variables are global and they are used …

Member Avatar for Bheeman89
0
2K

The End.