19,876 Topics

Member Avatar for
Member Avatar for tonybowry

Hi all I've only been learning C for 6 weeks and have a project to convert arabic numbers to roman numerals. Part of the prgram must do this in batch mode. i.e. read integers from .txt file, convert and write numerals back to .txt file. It seems to be working …

Member Avatar for tonybowry
0
72
Member Avatar for atman

hello., in a few examples i noticed that pointers are declared in functions parameter list. ex [CODE] #include <stdio.h> void SwapEm (char *p_grade1, char *p_grade2); int main () { char grade1= 'D', grade2 = 'A'; printf ("At the beginning grade1 is %c and grade2 is %c\n", grade1, grade2); SwapEm (&grade1, …

Member Avatar for devnar
0
292
Member Avatar for riahc3

Hey I have this code: [CODE] void menu() { char opt do { system ("cls"); printf ("1 - Option 1"); printf ("2 - Option 2"); printf ("3 - Option 3"); [B]scanf ("%c",&opt);[/B] [B]}while ((opt!="1") && (opt!="2") && (opt!="3"));[/B] [/CODE] The lines in bold are the ones Im not sure about. …

Member Avatar for riahc3
0
161
Member Avatar for Undermine

[B]HEADER FILE:[/B] [ICODE]#include <string> using std::string; class Blackjack { public: Blackjack(string); void Shuffle(); void Intro(string); void InitDeck(); void PrintCard(int); // void Card(int); private: int deck[52]; //deck of 52 cards. }; [/ICODE] [B]BODY PROGRAM.[/B] [ICODE]#include <iostream> #include <fstream> #include <cctype> #include <cstdlib> #include <ctime> using namespace std; #include "bj.h" Blackjack::Blackjack(string name) …

Member Avatar for Undermine
0
131
Member Avatar for patkhor

Hi, I'm using fgets() to read lines of text file and display them. The fgets() is in an infinite loop. The problem occurs when I remove lines from text file while program is running. The lines count is correct, but the program display the old content of the file up …

Member Avatar for patkhor
0
104
Member Avatar for msundastud

ok, once again, I'm back...after this program I don't plan to write anymore...here's the task... Program # 1: Write a program that can decrypt the following string Ukjv!lt#xkz#DVT#sxmht1 Each character must be decrypted by applying the decryption algorithm to its ASCII value. The decryption algorithm is: • if array index …

Member Avatar for devnar
0
119
Member Avatar for dampecram

Hello, the program I have creates a database and lets you update/add/delete any information you want about hardware items. My problem is.. after I exit the program, all the data is lost in the binary file. I need to keep a database in a binary file and update it everytime …

Member Avatar for Ancient Dragon
0
101
Member Avatar for atman

hello., ny1 knows what is the data type for displaying hex numbers? i know that specifier is %x, but dont know what data type it is ex: 0xBCD thanx!

Member Avatar for devnar
0
88
Member Avatar for BigFormat

Hello, I need to create some dirs (one for each user), taking the dir name from a given string. I managed to do this with the following code: [CODE=C] DIR *dir_ptr; char *target_dir; target_dir = malloc(32*sizeof(char)); for(all users) { /* Set username for current user */ target_dir[0] = '\0'; strcat(target_dir, …

Member Avatar for Salem
0
104
Member Avatar for slimjimmer

Hey, I'm really stuck on a program I have to make for a class. We have to integrate f(x) = cos^2 (x). We are given a file with values of x and corresponding values of f(x). We have to use a while loop to do the following sum: sum to …

Member Avatar for slimjimmer
0
128
Member Avatar for T'Scoopz

1) How can I use fscanf to read only the first character of each word in a text file? 2) How can I use fscanf to read only alphabets in a text file? - I tried %[a-zA-Z], but that doesn't work for some reason.

Member Avatar for Salem
0
74
Member Avatar for I.odine

Hey everyone - Im new here. I appreciate any and all help you guys can provide! this is driving me crazy, and I am still wet behind the ears when it comes to asp.net. I have 2 pages, index.aspx and downloads.aspx. There is a form on index.aspx that on submit …

Member Avatar for serkan sendur
0
189
Member Avatar for sambafriends

Hi, the concept of the program is enter a piece of text from the keyboard and place that piece of text into a file [code=c] #include<stdio.h> #include<conio.h> #include<stdlib.h> #include<string.h> void main() { FILE *fp; char s[80]; fp=fopen("new.txt","w"); if(fp==NULL) { printf("unable to open file"); exit(1); } printf("enter new line of text:\n"); …

Member Avatar for devnar
0
135
Member Avatar for Krysis

Hello again... So, I'm trying to read a file line-by-line and compare the first 5 characters of that line (that was read in) to another character string. If they don't match then it moves on to the next line of the file and tries to compare again. The problem I'm …

Member Avatar for Krysis
0
5K
Member Avatar for sambafriends

strunct num { int count; }; void main() { num n1; num *p; p=&num; scanf("%d", p->count); printf("%d", p->count); } when I attempting to do this one I got the error message like 0 Null pointer .....

Member Avatar for sambafriends
0
277
Member Avatar for Krysis

[COLOR="Red"]ATTENTION[/COLOR]: SKIP WHAT'S WRITTEN IN [COLOR="Red"]RED[/COLOR] UNLESS YOU WANT TO KNOW [B][I][U][COLOR="Red"]EXACTLY[/COLOR][/U][/I][/B] WHAT'S GOING ON... NOT NEEDED THOUGH! Well, let me first ask the general question/problem that's plaguing me in this "Coded Adventure"... [COLOR="blue"] "Let's say I've opened a file for reading and the file that I'm reading contains: Hello …

Member Avatar for Krysis
0
138
Member Avatar for nidhi89

i m new 2 programming so could anyone help me or give me a idea 2 how develop examination management system in C wat features should i aad 2 it before making a program of that

Member Avatar for Salem
0
56
Member Avatar for CoolAtt
Member Avatar for c_skyscraper

Hello Everyone, I have a terrible problem with data structures in C. i have defined a structure as below: struct MNT { char label[32],opcode[32],operand1[32],operand2[32]; struct MNT *next; }; typedef strct MNT *MNTABPTR; MNTABPTR mnt_first = NULL; and for allocating memory i used the following sentence: MNTABPTR newnode; newnode = (MNTABPTR)malloc(sizeof(MNTABPTR)); …

Member Avatar for c_skyscraper
0
120
Member Avatar for cutedipti

H! I have to write a program for sorting two dimensional array(e.g. Matrix) without converting it into a single dimensional array or using pointer concept. So, can u please give me any idea for writing this program?

Member Avatar for ArkM
0
103
Member Avatar for Nemoticchigga

Is keil software for programming microcontrollers a free tool, or does it need to be purchased with a license? Thanks.

Member Avatar for Colin Mac
0
104
Member Avatar for Whilliam

hello guys, Im trying to understand how fread and fwrite works. My teacher said that these functions can store/output binaries and texts in files. I know how to do it with string. Im confused with floats and integers. I tried to make a program for it but Im getting errors. …

Member Avatar for Whilliam
0
248
Member Avatar for monkey_king

I've made a program using gcc as a compiler. In my loops I've been using a uint type as the type of my loop variable. But now it seems that some systems doesn't support this type. Can I make a preprocessor conditional that does a #define uint to unsigned int …

Member Avatar for WaltP
0
160
Member Avatar for nidhi89

please help me in making project of 15-20 pages in C programming on Examination Management system

Member Avatar for ddanbe
0
235
Member Avatar for trashed
Member Avatar for mohit12

i am complete novice at image processing please i have a problem plz can any one of u can provide me with a simple c or c++ code for the problem ...............with comments i have a floor plan of a building here is the link [url]http://www.plantechdesign.com/planimages/PBM040.jpg[/url] our software can divide …

Member Avatar for Paul.Esson
0
157
Member Avatar for valchid

hi,can someone please tell me how i can read in data,save data to a file and print it out to the screen using the "gets" statement.My code starts something like: [code=c] #include <stdio.h>; #include <stdlib.h>; struct { char make[10]; char model[10]; double cost; int yearMade; }cars; int main () { …

Member Avatar for valchid
0
101
Member Avatar for psyman_86

Hello everyone, I am having problem with a multiple public definition: ERROR L104: MULTIPLE PUBLIC DEFINITIONS SYMBOL: currenpacketbeingsampled MODULE: DataSampling.obj (DATASAMPLING) DEFINED: Main.obj (MAIN) The variable in question is defined only once in the header file, and only used in the associated C file. From my understanding a macro guard …

Member Avatar for psyman_86
0
260
Member Avatar for vahny

[code] #include<iostream.h> int main() { int row1[10]; int col2[10]; int m,n,p,q; cout<<"Enter the number of rows in matrix A"<<endl; cin>>m; cout<<"Enter the number of columns in matrix A"<<endl; cin>>n; cout<<"Enter the number of rows in matrix B"<<endl; cin>>p; cout<<"Enter the number of columns in matrix B"<<endl; cin>>q; if(n!=p) { int …

Member Avatar for cikara21
0
178
Member Avatar for Tank50

Hi Guys Most of time iam interest do a programming using C# language,but I got a project for PDA,so I hope to developed it using C language,Iam new to C language and ,what steps i have to do learn C language.Starting from first i think its time wasting,so what is …

Member Avatar for William Hemsworth
0
146
Member Avatar for dusse

Hello guys.. I´m trying to do something like the code below .. [code=c] struct node{ int a; char *s; }; void main() { node *x; int sMAX = 3; int nodeMAX = 10; x = (node*)malloc((sizeof(int)+sizeof(char)*sMAX)*nodeMAX); ... } [/code] in other words I want to alloc dynamically the number of …

Member Avatar for Narue
0
218
Member Avatar for salman213

Hi i have a question. Im using Dev C++ and this simple program takes in values of x and outputs *prints them on the screen. Although x should be an integer If i put in for example the letter "u" or any letter for that matter it goes on and …

Member Avatar for Narue
0
128
Member Avatar for lehe

Hi, I have an array. I put its definition in a .c file and externally delare it in a .h file like this: //.c file unsigned char jetmap[][]={ {0, 207, 255}, {0, 223, 255}, {0, 239, 255}, {0, 255, 255}, {16, 255, 239}, {32, 255, 223}, {48, 255, 207}, {64, …

Member Avatar for lehe
0
119
Member Avatar for tanman

i have a major problem with my c - media ac97 audio device. my computer crashed and ive just recently rebooted it but now i cant get the sound to work. ive tried to install the driver for the speakers but it doesnt seem to work. everytime i try to …

Member Avatar for murrayhunter
0
201
Member Avatar for bondo

Basically I'm reading from a file and populating a dynamically allocated array with the words that are in the file. I've already read through the file to figure out what numArts is, so I know how many words there are in the array. This works up until the: [CODE]arts[index] = …

Member Avatar for bondo
0
174
Member Avatar for lehe

Hi, I got this message "Windows has triggered a breakpoint in inout.exe. This may be due to a corruption of the heap, and indicates a bug in inout.exe or any of the DLLs it has loaded. The output window may have more diagnostic information" while debugging the following program in …

Member Avatar for lehe
0
208
Member Avatar for xlx16

when i wrote the following program in turbo c,the out put was right but when i wroted it in borland c,the out put was wrong and the (*) was printed in wrong place,so what is the problem with borland c for dos.for another example i wrote a program which contained …

Member Avatar for ajay.krish123
0
119
Member Avatar for nectionplayer

What are the likely questions to come in a C programming exam.(It's a cirtificate course) Please add your answers to the questions.

Member Avatar for ajay.krish123
0
65
Member Avatar for CoolAtt

hi ! does anyone know how to install & use the perl compatible regex (PCRE) api in Bloodshed Dev++ ?

0
93
Member Avatar for Terlington

Hi All, I'm actually making a little program but I'm encountering an error that I can't manage to resolve. So I have a linked list of "User" (each User has got a pointer to the previous User and another pointer to the next User). At First, the List is empty …

Member Avatar for Terlington
0
127
Member Avatar for barbaruiva

friends before any thing apologizes for English I am using translator because only of the brasil and I don't know how to write. my problem is the following I have to create a program that reads a text and it prints the same text to the I thwart oh this …

Member Avatar for Ancient Dragon
0
69
Member Avatar for Tausif214

please help me with this Assignment: Write a program that will read the critical path information from the attached file (ProjectInfo.txt) into 3 arrays, events, tasks and numDays and defines a 4th array called eventNumDays in which you will calculate the number of days needed for each event to complete, …

Member Avatar for Tausif214
0
101
Member Avatar for nisha_fortune

Hi, I have to create a map table in C. I have used the following codes : [COLOR="Red"]************************************** #include <map.h> using namespace std; map <char,char> fileMap; fileMap.clear(); CL_LOG_INFO(" Putting into HASH MAP"); // Storing into the map fileMap.insert(make_pair(key_xsd,key_moc)); CL_LOG_DEBUG("hash table"); CL_LOG_DEBUG(fileMap); *************************************[/COLOR] I am getting following compilation errors : [COLOR="Green"]snmpd.c:379:17: …

Member Avatar for Nick Evan
0
157
Member Avatar for cutedipti

H! Aim of my program is: Write a program [B]using recursive function[/B] for sorting numbers entered by user [B]without using array concept[/B] to hold elements/numbers. Output of the program will be as follows: [B]Enter the number of elements you want to sort:[/B] 12 [B]Enter the elements for sorting:[/B] 3 7 …

Member Avatar for Nick Evan
0
110
Member Avatar for hello420
Member Avatar for xlx16

i have two questions,please dont tell me that i violate dani web ruls because of my long questions thank u. one: i wrote a program in c,and i compiled it(in borland c),it had no errors(so far so good) then i run it and errors such as: linker error:undifined symbole_line in …

Member Avatar for ArkM
0
96
Member Avatar for hajjo

[url]http://www.sendspace.com/file/g0v6po[/url] thats my little code. When I execute it it gives me error..which it shouldnt. the ls is called, its result is stored in fd[1], and the second child (less) reads the answer from fd[0] ... its not working..anything wrong with close methods sthg..plz help

Member Avatar for Narue
0
105
Member Avatar for r.anshul

There has been a lot of confusion for Binary to decimal conversion and vice versa. Today morning i came up with some simple self understandable code !!! Binary to Decimal [CODE] #include <stdio.h> #include <math.h> #include <graphics.h> main() { int dec; int total; int power; clrscr(); total=0; power=1; printf("Enter binary …

Member Avatar for r.anshul
0
246
Member Avatar for nectionplayer

Write a C program that accepts a string from the user.The program is to determine if entered string is a palindrome or not

Member Avatar for Nick Evan
0
109
Member Avatar for BigFormat

Hello, I've to build a database of students in a certain school in which each student has a list of her/his passed exams along with the grade gotten. I have 3 structs and I need an advice on how to carry out memory allocation, eg. when I add a student. …

Member Avatar for Clockowl
0
3K

The End.