19,876 Topics

Member Avatar for
Member Avatar for shakunni

Hey, How do I create a file from a C program? I want to check if the file exists and if it doesnt, then create it. I am using the following code to check if it exists: [code] filecheck() { b=fopen("password.csv","r+w"); if(b==NULL) { // need code for creating a file …

Member Avatar for venomxxl
0
118
Member Avatar for tag234

Hello, I am currently trying to write a program that will read from either stdin from a file (using <) or from piped input. I have the portion using the < working because i am able to read the st_size of the file and create a read() call accordingly: read(0,&inptr,stdinfo.st_size); …

Member Avatar for banders7
0
194
Member Avatar for ranjithgoud

hi guys, i am ranjith intrested in writing c c++ progs i hav a doubt that can i write a c or c++ program to excute at a given time thanks

Member Avatar for abdelhakeem
0
924
Member Avatar for Sarang07
Member Avatar for idiotninjaz

Okayy, So. I'm required to make a new set of functions for the <string.h> library and am confused on a few things, and am wondering if anyone can help me out. I'll toss out the ones I'm struggling with. int mystrcmp(const char* s1, const char* s2); This function will compare …

0
90
Member Avatar for Iam3R

i have just written a small program on DEV C++. i have been using it for couple of months but i never observed this error. [CODE] #include<stdio.h> int main() { printf("Welcome\n"); system("PAUSE"): return 0; } [/CODE] could not create makefile I/o error 32 any idea? what does that mean

Member Avatar for Iam3R
0
96
Member Avatar for wangatang126

Hi i have a binary function search program where the user enters a index of numbers, then enters the number he wants to find. However my program wont compile and says the subscripted value is neither an array or pointer. Help me out please. Here is what ive got: [CODE]# …

Member Avatar for stephen186
0
104
Member Avatar for imolorhe

I was just wandering about the user interface of C applications. What are the basic things one should know about programming a graphical user interface with C.

Member Avatar for jbennet
1
105
Member Avatar for cutedipti

A hospital keeps a file of blood donors in which each record has the following information (i) Name (ii) Age (iii) Address (iv) Contact no. (v) Blood group. I have to write a program to enter record into a data file “blood donors.dat” and display information of each donors. And …

Member Avatar for Gaiety
0
97
Member Avatar for *nix

i am new to unix. i have written a code for testing the basic functions read / write and open i have read that read/write returns the no of bytes read/written but here my write is returning 1 and read is returning 0 no matter how many chars i write. …

0
50
Member Avatar for arsh_arsh

need to replace all occurences if substring by new string. below code replace first occurence but not other substrings present in input string.

0
251
Member Avatar for smithu.simi

Does anyone out here have an idea as to how to go bout simulating a DFA (deterministic finite automata) in C which accepts multiples of 3 ?????

Member Avatar for thines01
0
78
Member Avatar for raigs

I get this gcc warning with [I]-Wwrite-strings[/I] flag. I want to return a string of chars correctly but I also do not want to use [I]malloc[/I]. I've read other posts but can somebody explain how to acheive this in layman wording? [QUOTE]a.c:14: warning: passing argument 1 of ‘VAR1’ discards qualifiers …

Member Avatar for Dave Sinkula
0
396
Member Avatar for tjackson

I am new to c programming. I am trying to write a parking garage program that uses arrays to find the charge for each car and the total charge. Here is what I have so far. Please help me in any way that you can. [code=c]#include <stdio.h> #include <math.h> float …

Member Avatar for Chilton
0
145
Member Avatar for Aamit

[code=c] #include <stdio.h> #include <conio.h> int main(void) { unsigned port = 0; int value; value = outp(port, 'C'); printf("Value %c sent to port number %d\n", value, port); return 0; } [/code] It gives error 8 C:\Dev-Cpp\Abc\... `outp' undeclared (first use this function) How to solve this ?? I write function …

Member Avatar for BobClark
0
593
Member Avatar for thebluestar

[CODE=C] #include<stdio.h> #include<conio.h> #include<string.h> //typedef int BOOL; //#define TRUE 1 //#define FALSE 0 int a[3][4]; int Prime(int *x); void input(); void printOut(); void checkPrime(); int Prime(int *x) { int i; for( i=2; i< (int)sqrt(*x); i++ ) { if( *x%i == 0 ) return 0; } return 1; } void input() …

Member Avatar for thebluestar
0
195
Member Avatar for thebluestar

[CODE =C] #include "conio.h" #include "stdio.h" #include "math.h" int isPrime(int n) { int i,isTrue=1; for(i=2; i<(int)sqrt(n); i++) if(n%i==0) return 0; else return 1; } int main() { int N; printf("Enter n: "); scanf("%d",&N); if(isPrime(N)) printf("prime"); else printf("Not prime\n"); getch(); return 0; } [/CODE] here is my source code, but when …

Member Avatar for thebluestar
-1
150
Member Avatar for debasishgang7

Hi all I want to make an Instant Messenger Client(like gtalk)with c++. any one know something pls. help me out. if you know any available web resources pls. let me know about that .... I need only the code.I dont want the GUI prog.. pls.. pls..

0
103
Member Avatar for dylank

Hi, I have a program that I am using to convert a string into binary. My current code is as follows: [CODE]int main(void) { string userInput; cout << "Enter a string to be converted:" << endl; cin >> userInput; for (int index = 0; index <= userInput.length(); index++) { cout …

Member Avatar for dylank
0
162
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
177
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
165
Member Avatar for hakan5

Good day. Here's my code. My uncle helped me with it for days but he's now out of the country for 2 weeks. I'm looking for help to improve this project of mine with mutex and semaphores. I've never used them before and I'm a little confused. I'm running this …

0
55
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
138
Member Avatar for vikasbe

hello, i m using c# and vb both in my web project. it gives error when connectin c# page with database. it is not taking any label taken in c# page. can anyone help me.

Member Avatar for kvprajapati
0
35
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
164
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
108
Member Avatar for HypnotiqBIG

Hi, I have an assignment where i have to write a C and assembly mixed-mode program. [LIST=1] [*]The c program takes in two characters which stand for two hex characters. [*]The assembly procedure then passes each character in turn to a C function which determines if the character is a …

Member Avatar for HypnotiqBIG
0
224
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
102
Member Avatar for ganbree

I'm trying to advance my understanding of how computers and compilers work. Given the C++ program bellow with exceptions and runtime typing turned off and no optimizing that removes main or makes it into a non-standard function. [code=c]int main() {return0;}[/code] Produced an disassembly with the following code for main: [code=asm]pushl …

0
83
Member Avatar for EastJohn

My array keeps outputting this random character (kind of like a # in a box). Anyways, its just garbage really, but how do i stop it from doing this. If my array was like char title[10] and the user inputted something with only 5 characters, then the remaining characters would …

Member Avatar for restrictment
0
120
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
136
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
158
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
88
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
172
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
136
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 futureaussiecto

Hey guys, im about to write an application which has a visual GUI doing representation of a system (lots of pretty colours and flashing objects etc), which represent what is happening with packets and external devices being inserted into the system. I need to use one of the Win32 APIs, …

0
46
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
259
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
161
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
102
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
178
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
96
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
121
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
83
Member Avatar for Dekken

Hi I'm creating a multiple form GUI app using a scene-manager to set the current visible form. There isn't an issue regarding it working, that's fine. What I am noticing is that when each form is set to be active/visible, it takes a few seconds to load each component, and …

Member Avatar for Dekken
0
240
Member Avatar for free_eagle

Dear forum members, Could you please let me know from your experience the best avaibable textbooks to learn C# effectively with examples? I am planning to start to learn C# programming but I have no idea from where to start and which book to read. I have Deitel's books Programming …

Member Avatar for gira
0
342
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
133
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
175
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
141
Member Avatar for simplyscottif

[CODE] #endif class BankAccount { public: double enterAccountData(); double computeInterest(); void displayAccount(); private: int accountNumber; double accountBalance; static const double RATE; } #include "stdafx.h" #include <stdlib.h> #include <conio.h> #include <stdio.h> #include <dos.h> #include <ctype.h> #include<iostream>// holds the cin and cout commands #include<conio.h>// holds the getche() instruction using namespace std; //#include …

Member Avatar for jonsca
0
171

The End.