15,551 Topics

Member Avatar for
Member Avatar for koti86
Member Avatar for jon.kiparsky
0
79
Member Avatar for JSpudMonkey

Hi, still very new to the C Language and just needed some Clearing up and some help please. Im writing a program where i have to read from a file that says the name of a person and 6 "lottery" numbers in this format. [ Mike Kobalt 12 15 34 …

Member Avatar for JSpudMonkey
0
125
Member Avatar for Juzaguy

[CODE]/* Round Robin Scheduling Simulation*/ #include <stdio.h> #include <stdlib.h> ////////////////////////////////////////////////////////////////////////// /* Process Data Structure */ struct process { int pid; /* Process ID */ int burst; /* CPU Burst Time */ int priority; /* Priority */ int working; /* Working time, for round-robin scheduling */ int waiting; /* Waiting time, …

Member Avatar for Juzaguy
0
229
Member Avatar for techie1991

I have just started writing C code in dev-c++. The programs are running fine, but each C program shows me the following warning: [QUOTE] [Warning] command line option "-fno-access-control" is valid for C++/ObjC++ but not for C[/QUOTE] The test program I used was: [CODE] #include<stdio.h> int main(){ system("pause"); return 0; …

Member Avatar for Kanoisa
0
564
Member Avatar for DemiSheep

Question of the century? I basically want to know which would be more efficient if I wrote this code as several different variables or if I used small arrays. [code=c] int x = 34; int y = 28; int z = 293; [/code] vs [code=c] double coordinate[3] = {34, 28, …

Member Avatar for jon.kiparsky
0
188
Member Avatar for tyalangan

Hello Everyone, I've been desperatly trying to teach myself C and I've come along quite nicely. I wanted to start making my own programs (not from internet tutorial/Cd Rom). I want to make a program that will display two dates that the user inputs then calculate the number of days …

Member Avatar for Davish
0
273
Member Avatar for guru_iyer

I've been trying to display the equivalent decimal number of the input binary number. I tried the below piece of code but am not achieving the result. I don't seem to understand why? Please Help!! [CODE] #include<stdio.h> #include<conio.h> #include<math.h> int a=0; int main() { char bin[8]; int i=0,len=0,r=0,w; printf("Enter a …

Member Avatar for volvo877
0
508
Member Avatar for Auraomega

I've never used inline assembly shockingly, and I'm just wondering how/if I can do something. Bit of background; I'm coding a basic OS kernel, I have various subroutines written in assembly and amongst others I have a puts subroutine that is an attempt at mimicking puts in C. In order …

Member Avatar for Auraomega
0
122
Member Avatar for joelogs

we are given the assignment to implement the banker's algorithm in c. this implementation must run in the linux terminal and program must be utilized the os in the time of execution. this means that it must capable on real-time execution with the os. i really don't have any idea …

Member Avatar for jon.kiparsky
0
1K
Member Avatar for visitor11

i m using dev c++ for opencv i got problems in displaying image here is the code #include "cv.h" #include “highgui.h” int main( int argc, char** argv ) { IplImage* img = cvLoadImage( "M.jpg"); cvNamedWindow( “Example1”, CV_WINDOW_AUTOSIZE ); cvShowImage( “Example1”, img ); cvWaitKey(0); cvReleaseImage( &img ); cvDestroyWindow( “Example1” ); } …

0
80
Member Avatar for GAslugger

How do you write Hello world in dynamic C is this correct? main() { printf("Hello World"); }

Member Avatar for Auraomega
0
185
Member Avatar for MareoRaft

Here is a simple program which gives me unexpected results: [code=c]int main() { printf("\nTo calculate a^b, enter value a now.\n"); int a = getchar() - '0'; printf("\nEnter b now.\n"); int b = getchar() - '0'; printf("a = %d, b = %d\n\n", a, b); return 0; }[/code] if i hit a …

Member Avatar for MareoRaft
0
3K
Member Avatar for gaurav_13191

Hi, I want to know which function can be used for inputting a number of lines in C?

Member Avatar for Narue
0
62
Member Avatar for acer5542

Hey guys, I have to write a c code for an emulator of a very simple CPU. The CPU uses 16 bits for all addresses and data and has three registers, I, A and PC. The instruction cycle is as follows: 1. Fetch the operand for the current instruction (an …

Member Avatar for Adak
0
114
Member Avatar for gaurav_13191

I found the following code on internet for adding two numbers using pointers:- [CODE] #include<stdio.h> int main() { int a=30000,b=20,sum; char *p; p=(char *)a; sum= (int)&p[b]; printf("%d",sum); return 0; } [/CODE] But I can't understand how p holds the value 30000 or how the result of the program is addition …

Member Avatar for Narue
0
188
Member Avatar for sayantani nath
Member Avatar for vipin.sachan

While compiling ProC application on AIX...getting the following error proc iname=v4_mcdr_6010 ProC/C++: Release 10.2.0.1.0 - Production on Fri Jul 2 11:15:52 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. System default option values taken from: /edw/ora10gclient/10.2.0/client/precomp/admin/pcscfg.cfg Parser error at line 756, column 32, file /usr/include/sys/thread.h: Error at line 756, …

Member Avatar for Sholiem
0
790
Member Avatar for rahul8590

Honeslty have no idea on how is the output being generated ? [CODE] #include <iostream> int main(int argc, char** argv) { int i=1,j=-1,k=0,l=2,m; m=i++||j++&&k++; printf("%d %d %d %d %d",i,j,k,l,m); return 0; } [/CODE] output : 2 -1 0 2 1 evwn though j++ is is present that value is not …

Member Avatar for kings_mitra
0
112
Member Avatar for GregMalick

I'm trying to write a Windows App that will let me write or draw in a window and still see what's below. Kinda a transparent Notepad with Borders. It's easy to create a transparent Window using: CreateWindow() with wndclass.hbrBackground = (HBRUSH) 0; But in the CALLBACK WndProc() where I'm drawing, …

Member Avatar for GregMalick
0
227
Member Avatar for gameon

I am trying to make a c programe which will work like dos copy command. I am able to copy the one txt file but this programe is not working with other extension file. [CODE]Void main() { FILE *fp,*fp1; char c; fp=fopen("source","r"); fp1=fopen(" destination","w"); while((c=getc(fp))!=EOF) putc(c,fp1); fclose(fp1); fclose(fp); }[/CODE]

Member Avatar for Adak
0
80
Member Avatar for gaurav_13191

Hi coders,I have a small problem regarding pointers, I am a bit weak in pointers and need to understand why the following is wrong: [CODE] int main(void) { char *a; gets(a); return 0; } [/CODE] This causes an exception, please explain the error. I am using Turbo C as compiler, …

Member Avatar for gaurav_13191
0
104
Member Avatar for DemiSheep

I have never programmed in C and have not programmed in C++ for a little while and either way, I am still learning. I am writing a program in C and am converting a MATLAB program to this C program. I have a lot of variables from MATLAB that are …

Member Avatar for Ancient Dragon
0
125
Member Avatar for Jamesbch

Hello there, I'm developing a server which use epoll to manage the incoming connections. I'm working at the moment on timers and I'm using the [I]setitimer[/I] and [I]sigaction[/I] interface of Linux. It's working well but I've found out that epoll and setitimer conflict each other: I guess they share the …

Member Avatar for Jamesbch
0
321
Member Avatar for SHENGTON

Hello, I got working code of Linked List here. But I having a problem with adding an item. I added four numbers in the Linked List. First, I added 2 then 8 then 4 and the last one 16. The result would be like this: [IMG]http://i168.photobucket.com/albums/u162/SHENGTON/display-1.jpg[/IMG] What I want to …

Member Avatar for kings_mitra
0
180
Member Avatar for moonw3ll

Will atoi() convert the convertible characters in a string? I mean, in this problem, [code=c]post[20]="822*/3+2"[/code], if i write [code=c]atoi(post)[/code], will it convert the numerical characters to int? And how about the operators?

Member Avatar for gerard4143
0
83
Member Avatar for moonw3ll

[CODE]strcpy(post[j],in[x]);[/CODE] Just what is wrong with this code of mine? in[x]='4' But it doesn't copy the value to post[j]

Member Avatar for abhishek das
0
99
Member Avatar for gkkmath

Hi Experts, I'm writing a C program (cut/paste below) to establish a TCP socket connection from my Mac Pro to a Windows XP-based test instrument sitting next to it over LAN (Ethernet). The program compiles without any warnings or errors. But executing the code using GNU Debugger, I can see …

Member Avatar for gkkmath
0
167
Member Avatar for D33wakar
Member Avatar for gerard4143
0
108
Member Avatar for Joe Shmoe

I was looking at the following site because I am interested in making a basic-like interpreter in c. Can someone explain how the switch case works in this particular program? You probably need to read the code to know what I mean. I know how to use switch case, just …

Member Avatar for Joe Shmoe
0
3K
Member Avatar for rapids79

Hi..I am working on a program to create a rotated ellipse using 4 known points and the angle of rotation. During the process I encounter a set of homogeneous equations. Is there anyway to solve homogeneous equations in C??? Solving homogeneous equations by hand is quite differrent because you would …

Member Avatar for Ancient Dragon
0
100

The End.