19,876 Topics
![]() | |
I am doing fork(), I need to send messages between parent & child.. am using this.. char readbuffer[80]; int fd[2], nbytes; if(child == 0) { close(fd[0]); nbytes = read(fd[0], readbuffer, sizeof(readbuffer); index = atoi(readbuffer); } else{ close(fd[1]); sprintf(sending, "%i", index); write(fd[1], sending, strlen(sending)+1); } Index is an integer am sending … | |
I have got xampp-linux-1.6.7 and xampp-linux-devel-1.6.8a installed on Ubuntu 8.10. I am trying to install mod_wsgi-2.3 and was able to sucesfully run ./configure on it. But when I run make, it gave me a bunch of errors. I am pasting a snipped of it here. [code]mod_wsgi.c:3886: error: expected โ;โ before … | |
once again teaching myself to write using C, damn I miss C++ the question is to write a program that can calculate the first, second, and third quartiles for a set of data. I need to declare 2 arrays, each having 3 columns. The quartiles will be calculated for only … | |
Hi. The program works fine if i just compile and run. But for the program to get graded it has to pass a test written in python which it does not. Since i'm complete dummy at c and programming if you find to explain, dumb it down please... so here … | |
1) # define cube(x)(x*x*x) main() int x=2. y, z; y= cube(++x); z= ++y + 386 / cube(++x); printf("%d %d %d", ++x, y, z); convert into hexadecimal 2) a = 0*aa b = a<<1 a) b=a b) b= 2a | |
I am having a problem with a class I am writing. I have defined a whole bunch of methods defined that the compiler is telling me in the implementation are different. The errors are: [QUOTE] 1>------ Build started: Project: prog6a, Configuration: Debug Win32 ------ 1>Compiling... 1>main.cpp 1>c:\users\philip\documents\visual studio 2005\projects\cs211\prog6a\prog6a\avltree.h(186) : … | |
hello i am new in the programing and i want ัะพ learn c++.Where i can find good tutorials about c++ ---------------------------------------------------------------------------------------------------------- Thanks in advance | |
Do anyone have any idea to write a c progrm which counts no of times it is run without using a updating file??:?: | |
Can someone either give me a couple links, or some code with explanations on how to create gui (graphical user interface) buttons that are like boxes with text and color in them, that are equal to a command when you click them. Also, how do you create a gui slider … | |
Hello., Im learning C online, and one of the examples from the internet is this: [CODE] #include <stdio.h> int CalcVolume (int length, int width, int height); void PrintIt (int vol); void main() { int volume1, volume2; int x = 8, y = 15, z = 20; volume1 = CalcVolume (10, … | |
Basically what my program does. It has one main. It has one function. The function is: [CODE]int humhum (unsigned long x, unsigned long y) { unsigned long res; printf("Enter an integer for x:"); scanf( "%ul", &x); printf("\nEnter an integer for y:"); scanf("%ul", &y); res = x ^ y; } [/CODE] … | |
I am trying to solve a typical 0/1 knapsack problem (using greedy algorithm). In this problem I have to sort a structure consisting of 2 ints (one that contains the value and their corresponding amount I have to minimize the value to get `n' amounts so i need to sort) … | |
hi everyone, I'm trying to write a program that calculates the the fourth sqrt() of an int ..., can someone help me thnxx | |
please can any body tell when a new OPERATING SYSTEM kernal works then how it reads the hard disks .Is any body is interested in operating system developement. We are trying to make an OS which is independent in nature .Not UNIX type or WINDOW any body interested can send … | |
Well I'm about 1000 lines of code into my first program. After having recently "compartmentalized it" into small functions for readability's sake, I now find myself passing upwards of 8 or 9 variables into them. As I'm thinking of how the program will develop, I realize I'm probably going to … | |
#include <iostream> ; #include <fstream>; #include <string> ; #include <iomanip> ; using namespace std ; int main ( ) { string name; int m1 ,m2, m3; float avg; ofstream outfile("mark.txt") ; cout<<"Write your name :"; cin>>name; cout<<"input 3 marks:"; cin>>m1>>m2>m3; avg=m1+m2+m3/3.0; cout <<showpoint << fixed << setprecision (2); cout<<"ur average … | |
Hi does anyone knows how to sort in link list, i already done some parts of it and its already working except for the sorting part. please help me about this sorting problem... [CODE]#include <stdio.h> #include <stdlib.h> struct nodeTag { int nData; struct nodeTag *pLink; }; typedef struct nodeTag structNodeType; … | |
So I went to my prof. for help with a particular problem and this is the answer I got. I understand the majority of the answer but I have a few more pointed questions. 4. (6 points) A computer has 32-bit instructions and 12-bit addresses. Suppose there are 250 two-address … | |
Hi guys .. 1) is there something like that we have a limit upto which we can create a pointer to pointer to pointer.. i.e int ***********P... like this to which extent we can do this 2) is this allowed if in file one i declare a global variable int … | |
Well, I'm an IT professional in my first real IT job. Unfortunatly I've come across this problem that I don't know how to solve. We have a computer where we have all of our shared files located on a seperate drive called the F drive. Which there is 215GB of … | |
Hello again guys! i have a simple question how to promt user to enter a number for example 444 or whatever and for c to print it as a 9 digit number, so if its 444 c would print it as 000000444? any help would be greatly appriciated., thanx! | |
I am just trying to explore c and i was wonder what is reason behind ... segmentation fault.. but second function is workiing .. can someone explain me reason [code=c] void myfunc1(char *t) { t = t+1; t = 'l'; //it gives segmentation fault ? why } void myfunc2(char *s) … | |
Just trying to compile some code with tcc: [CODE] #include<stdio.h> main () { int x = 10; int *p; p = &x; x = 40; printf(โ%d %d %d %dโ,x,&x,p,&p); } [/CODE] Trying to learn about pointers and memory addresses and I took the code right out of the book, any … | |
![]() | I'm having trouble implementing isalpha in the correct spot. When I put it in the if statement, it doesn't determine the palindrome correctly. It says everything I entered is a palindrome. Then I try to implement it with the int k, but then it gave me "parse error before +," … |
![]() | Hi all - I need some advice on how to handle multithreading in a GUI. I wrote an application in C# using only the GUI thread (see screenshot) and at times there are "long operations" where the database is being accessed and the right hand pane is being filled with … |
I have to parse the following file in C and call like specific things like ingridients, time and stuff, so how do I go about storing it in a file. The recipes repeat over and over in same format. ************************ Recipe: "Creamy" Salmon Over Pasta By: Skinny One-Pot Meals, Ruth … | |
I am trying to count the number of each letter grade for a list of students and count how many are male and female and how many students there are total. The problematic section is: [code] int ItemType::CountItems(int& ACount, int& BCount, int& CCount, int& DCount, int& FCount, int& MaleCount, int& … | |
hi..i ve programming in c and c++ for a long time now...i want to implement a simple code to kind of know and get started with rpc ... i've looked at many tutorials and all have the same code for printing a msg to the console here's the link [URL="http://docs.sun.com/app/docs/doc/816-1435/6m7rrfn7k?a=view"]http://docs.sun.com/app/docs/doc/816-1435/6m7rrfn7k?a=view[/URL] … | |
Hey Guys., Im super desparate have 1 day to hand this in. Have to use loops only. quote: The use of any of the following C statements or functions is not permitted under any circumstances. break; continue; exit(); abort(); No global variables. When the program starts it will prompt the … | |
Hi All, I need help figuring out how I can call the various functions in this program from main. I've figured out as much of the code I could, but now I'm stumped. Any help would be appreciated. [code] #include <stdio.h> float deposits[50] = {0}; float withdrawals[50] = {0}; char … | |
hi, i'm trying to figure out how to fix this warning: decode.c(77) : warning C4715: 'get_msg' : not all control paths return a value i understand that my get_msg could not always return a value, i'm just not sure how to state that in my code? can anyone suggest anything? … | |
Consider d_type=POINT_LONG in the following program. and data.Long=0xA; In the following program i am getting correct output in constDataArea[0],constDataArea[1],constDataArea[2], constDataArea[3] which is oxA, 0x0, 0x0, 0x0. But not able to write the same into ambi.dat file. Some junk value is inserting in the front. and writing 5 bytes instead of … | |
Hi, I have some text file like with following structure (also attached). I want to extract only data in the form of an array: ------------------------------------------ 2048 52 429 425 398 200.000000 0 638 940 921 906 25 26 27 25 61 4096 213 1116 1371 398 200.000000 --------------------------------------------- Could you … | |
Please help me find the sine series . My program is: [code] #include<stdio.h> #include<conio.h> #include<math.h> float facto(int a); int main() { int n,g,k,y; y=1; float s=0.0; float f=0.0; float l =0.0; float x; int t=0; printf(" limit is \n"); scanf("%d",&n); printf(" no. is \n"); scanf("%d",&x); x=3.14*(x/180.0); while(y<(n+1)) { g=y; if(g%2==0) … | |
I have this except from my program and would like to change the line showing the error to say red, how would I do that? switch (choice) { case 1: { printf("\nThank you for choosing the Del Mar Store"); printf("\nThe price you entered is: $%10.2f<<<<\n", (price)); printf("The Sales tax on … | |
In my HR interview, i had one question. But , i did not answer for this. Can any one give me answer for this? How to display the statement without using semicolon in c programming? i mean, you should use semicolon anywhere in the program. jillcatrina <snip fake signature> | |
Hey guys, so I have a question about actually calculating the size of the three fields and what cache block a hex number addresses. We're working with fully associative, direct mapped, and 2-way. It all went pretty fast and over my head but I don't think anything is too complicated, … | |
I have the code below and I keep getting an error saying that swap isnt a function. Just wondering if anyone had any idea why. Thanks void swap(double *x, double *y ){ double temp; temp = *x; *x = *y; *y = temp; void sort(double h[], int size){ int i, … | |
Hi All I have following code running on Vista Business under IIS7. It works, but is incredibly slow (about 20+ seconds). I have the same code in Java and it's instant. It appears to be the line "int bytesRec = sender.Receive(bytes);" that is the killer I'm very new to ASP … | |
Hello, im not necessarily new to c++ but i cant seem to find a good way to get input from other devices other then the keyboard. To get keyboard input i have been using [ICODE]GetAsyncKeyState();[/ICODE] i was wondering if there was a similar function to get input from other input … | |
using c we can develop an o s but where will it run or start to execute. who will execute the instructions of the kernel ? how to make a kernel,any idea or hint ? where do we get those low level services provided by assembly language functions ? there … | |
Hey Guys! I have a weired one here, it must be a post-test loop, and here is how result has to look like: Enter the Section Code: 0 Invalid value entered. Must be 1 to 4, please re-enter: 1 Enter the Student's ID: 456789 Enter mark#1: 10 Enter mark#2: -20 … | |
I'm trying to make this program work like a game of BlackJack. However, the program will not listen to me when I try to end the loop. does anyone have any sugestions on how to fix this program? [code] #include <iostream> #include <ctime> using namespace std; double card = 0; … | |
Is there any opensource xhtml parser (in C) available ? | |
what are available database management systems to use with c applications? | |
Hi All. I've compiled my code in Turbo C++ in a WinXp machine, Will i be able to execute the compiled code(.exe file) in Windows server 2003 or Unix Machine.If yes, is there any libraries or software i need to copy on the other machine. Thanks in advance | |
We are trying to design a C compiler using LEX, YACC that outputs the C syntax to three address code with LEX and YACC lex TAC.l yacc -d TAC.y gcc -c lex.yy.c -o TAC.lex.o With the following error: Expected specifier-qualifier-list before ETYPE Can someone please help out? TAC.l [CODE] %{ … | |
I am thinking about becoming a programmer and have a BA in socail science and computer tech certificate. Can I ge a job with just either a C ++ certificate or Java certificate. Which one would be better to take. Please advise. | |
Hello, I'm pretty new to C++ and I've been trying to this program to open a file and check if it exists for the last two hours. It seems like it should be so simple but it keeps eluding me. Here is the code in main that starts to run. … | |
I pretty much got my assignment working except for one part, I need to reverse the output if the user enters "-r" in the command line. Can anyone help me with this? EDIT: By reverse I mean list the last child first down to the original process. [code] int j … |
The End.