15,551 Topics
| |
How to find out original extension of a file in a terminal or online pls help me | |
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 … | |
[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, … | |
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; … | |
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, … | |
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 … | |
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 … | |
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 … | |
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 … | |
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” ); } … | |
How do you write Hello world in dynamic C is this correct? main() { printf("Hello World"); } | |
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 … | |
Hi, I want to know which function can be used for inputting a number of lines in C? | |
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 … | |
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 … | |
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, … | |
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 … | |
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, … | |
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] | |
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, … | |
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 … | |
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 … | |
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 … | |
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? | |
[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] | |
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 … | |
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 … | |
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 … |
The End.