19,876 Topics

Member Avatar for
Member Avatar for r@o

How to add two equations in c... I was given a hint i.e. to use sscanf and printf......

Member Avatar for ravenous
0
76
Member Avatar for rate

[code] unsigned int crc8(unsigned char *message) { int i, j; unsigned int byte, crc, mask; i = 0; crc = 0xFF; while (message[i] != 0) { byte = message[i]; crc = crc ^ byte; for (j = 7; j >= 0; j--) { mask = -(crc & 1); crc = …

0
56
Member Avatar for ak47kumar1

hey guys, I am a beginner and am having trouble loading data from an external data file and then loading it to the screen. It is supposed to be the temperatures from everyday for a year for 2 years. 1 column is 1930 the other 2000 This is my script, …

Member Avatar for ravenous
0
114
Member Avatar for yuri1969

Howdy, I need to print given path to a file. The problem is that my app is platform independent -> I can get a Win32 style path: [CODE]C:\foo\bar.dat[/CODE]. The problem is with printing single backslashes '' -> single char converts to "\char" style. I need to convert it somehow to …

Member Avatar for yuri1969
0
157
Member Avatar for gouzou

Hi to everyone! Does anybody know how to fix this issue? When i run the exe file in my pc, the non english characters (in my case greek) that are stored inside c code aren't displayed on the screen. (compiler=Visual Studio)

Member Avatar for Ancient Dragon
-1
81
Member Avatar for arcticM

I need to make UI in C# that works with an SQL DB. I thought piece of cake! I imported my DB files to the Visual Studio (add->existing item ->browes and add) I dragged the tables to my Forms & there were automaticly buttons like New, Delete, Save, next record,previous …

Member Avatar for kvprajapati
0
122
Member Avatar for vedro-compota

Hi guys) Please tell me - why is it impossible to keep global variables in C in a processor register? thanks in advance)

Member Avatar for vedro-compota
0
159
Member Avatar for tastyTreeHUGGER

I am basically done with this program, but now my only problem sorting the students GPA from lowest to highest. this is the .dat file (its the ways its suppose to look like when printed out): ANNA A ADAMS 11 A STREET ALLENTOWN PA 11111 11 5.50 BOB B BRADBURY …

Member Avatar for Adak
0
427
Member Avatar for TrueCoding

Im not sure what Ive done wrong but I'm trying to display my array but the program keeps ending so I cant see if its actually working. Im sure its a little mistake - Any help or suggestions will be appreciated. [CODE] # include <stdio.h> # define MAX 100 int …

Member Avatar for Adak
0
109
Member Avatar for moroccanplaya

i cant break out of this loop its driving me crazzy!! [CODE] while (1) { printf("please type in the path for the file you want to archive\n"); scanf("%s",&original_file); open_pointer = fopen( original_file, "rb"); original_pointer = fopen(original_file,"rb"); copy_pointer = fopen( archive_name,"ab"); if (copy_pointer NULL) { printf("\n copied successfull"); puts("\nenter x to …

Member Avatar for moroccanplaya
0
155
Member Avatar for Andrew J

Hello, first time posting here, but site has been plenty helpful to me so far, thankyou. Am currently working on C# oleDb connections with access .mdb files for a university project, i have the start of a program that works fine in university, but when i run it at home …

Member Avatar for Andrew J
0
95
Member Avatar for shinsengumi

Hi everyone! I'm transferring my C program that I created from Linux to WindowsXP. I would like to know what I need to download/install in Windows in order to compile and successfully run the program? Also, will I need to change some parts of the source code? I used socket …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for CanofCornInfini

Hello, I am new to C and not really sure how to do this. This program extracts and prints the rightmost digit of the integer portion of a float, and I need to convert it but I'm not sure how. [CODE]#include <stdio.h> void main (void) { float num; int rightdigit; …

Member Avatar for Shankye
0
155
Member Avatar for kapilsolanki84

i am using devc++ compiler. using c code created the window but its blank . now to write data something on it. like (say)write(create) the output of my own program into that window.in c. guide me pl.[CODE]. in this i have not inserted my own code. this code is used …

Member Avatar for WolfPack
0
218
Member Avatar for dspjm

What's wrong with the program? It went wrong when i print the numbers in the lists. After i prints the last number, it didn't stop, and the program went into wrong memory. Eager for your answer: [CODE] #include <stdio.h> #include <malloc.h> #define NULL 0 typedef int ELEMNT_TYPE; typedef struct node …

Member Avatar for ckoy
0
126
Member Avatar for hadoque

Hi I'm trying to extract the exponent and mantissa from a float. It seems that the most forward way would be to read the bits of the number, according to IEEE 754 ([url]http://steve.hollasch.net/cgindex/coding/ieeefloat.html[/url]). So I need to do bitwise operations to float variable. According to what I have found on …

Member Avatar for hadoque
0
170
Member Avatar for mahinirak

Hi guys, I am coding the solution to K & R 2nd edition. I compare my solutions with the C answer book. Sometimes i feel my code is shorter but whether it is better and whether it confirms to good coding standards is what i am worried about. So i …

0
80
Member Avatar for shinsengumi

Hello all. I created a C program that used MySQL in Linux and now I'm transferring the program to Windows. I would like to ask what software do I need to download/install in Windows to be able to compile and run the program there? Also, when the program is already …

Member Avatar for shinsengumi
0
159
Member Avatar for tomtetlaw

When I run my program, I get this runtime error: [code] Windows has triggered a breakpoint in quarantine.exe. This may be due to a corruption of the heap, which indicates a bug in quarantine.exe or any of the DLLs it has loaded. This may also be due to the user …

Member Avatar for tomtetlaw
0
215
Member Avatar for tanzi816

I'm trying to write a program that can win a Battleship game in fewer than 60 guesses. Since the Battleship game that I am writing this for uses a 10x10 array, I thought that first of all I would just try to win the game in 100 guesses before I …

Member Avatar for vinitmittal2008
0
235
Member Avatar for bflack

//I need help please? [CODE]#include<stdio.h> #include<iostream.h> class Time { public: Time(); ~Time(); void setTime(int, int, int); void printMilitary(); void printStandard(); private: int hour, minute, second; }; void Time::printMilitary() { cout<<"Military time: "<<hour<<minute<<second; } Time::Time() { hour=minute=second=0; } Time::~Time() { cout<<endl<<"Destructor code."; } void main() { Time wakeup, samplePM; wakeup.setTime(6, 5, …

Member Avatar for WaltP
0
464
Member Avatar for TrueCoding

Hi I need to have an array in my program that is defined by the user. I just need the user to enter the size of the array and then enter the integer values that they want to store in the array. I know how to declare the array myself, …

Member Avatar for vinitmittal2008
0
493
Member Avatar for chi18

Hi Can anyone Help me for the program in C Using Looping Statement Create A program That Input A number And Then Convert It in Asterisk using looping statement..eg input number 5 and the output is the 5 asterisk(*****)..help me plss...:icon_smile:

Member Avatar for chi18
0
84
Member Avatar for atoklas

I am trying to read in names and telephone numbers from a text file using fscanf. The format of the data is: 9073234 Colwer, Mrs J. 3823823 Le Boeuf, Mr S. To do this I am using the following line: fscanf(fpp,"%d %s %[^\n]s",&a,surnames[i],firstnames[i]); This works except for "Le Boeuf" where …

Member Avatar for milkz
0
222
Member Avatar for rockerjhr

how do i make a program that calculates the product of two vectors in C ? this is what i have but i think im doing it wrong i need some help? [CODE]#include <stdio.h> double inner(double m[ ] , double n[ ] , int size ) ; int main( int …

Member Avatar for Dervish1
0
244
Member Avatar for CJMW
Member Avatar for kamotekid08
0
240
Member Avatar for amari ♥

i need help with the following: make a program that gets the summation of a given number e.g. 4+3+2+1 implement it using both iteration and recursion ex. enter a positive number: 4 the sum is 10.

Member Avatar for Shankye
0
165
Member Avatar for kamotekid08

How can I create a program where the output is name,horoscope,birthdate and birthstone..

Member Avatar for kamotekid08
0
110
Member Avatar for degamer106

Hmm I was lookin through a recursion program in this book i have here and the only thing I'm having trouble with is the modulus operator. I know that it returns the remainder of 2 numbers. But, suppose I have this: x % y If x > y then the …

Member Avatar for Shankye
-1
254
Member Avatar for Dexxta27

[ICODE]int main() { int count,rec_temp[]); count=read_temps(int temps[]); rec_temps=hot_days(int count,int temps[]); return 0; } [/ICODE] Can someone identify the error in this code please. I'm using Codeblocks; it says that it "expected a primary-expression bofre "int" " It says the error occurs once in the first function call, and twice in …

Member Avatar for gerard4143
0
101
Member Avatar for fg_aa_c

OK so I use the following code to get a hash of a file and print it to the terminal. I want to then add this hash to a file with other text based data in it, so I assume I need to convert to ASCII somehow. I must also …

Member Avatar for fg_aa_c
0
87
Member Avatar for shanki himanshu
Member Avatar for Shankye
0
56
Member Avatar for gregbati080281

i really don't know how to use text file i i want to know the step by step procedure... please thank you very much..

Member Avatar for Shankye
0
119
Member Avatar for Plastix!!

how can one read from a file (.dat or .txt) using and linked list. ie. file 1 -> after reading from this list then user enters 1 for next which would print another file. file-> and so on

0
48
Member Avatar for Daita
Member Avatar for Shankye
0
110
Member Avatar for masterkei
Member Avatar for Shankye
0
88
Member Avatar for CanofCornInfini

Hello, I'm new to C and I'm not sure what is wrong with my code here. After I execute, I get this: Debug assertion failed! [program address] File: fgets.c Line: 60 Expression: str != NULL It's a really simple program. I'm trying to assign family data from the in file …

Member Avatar for Shankye
0
541
Member Avatar for Gaiety

below is the code for traversing a binary tree without using recursion but the problem with the code is we require array of pointers to store all the nodes address. in below program the parameter nodes in the function push is an array of pointers to store all the node …

Member Avatar for jl.lakhnai
0
179
Member Avatar for skorm909

I'm coding a game right now and everything works great that i want to have working right now, but there's a minor bug that i know of. this is that when the player enters their name, and the name has spaces, the code just closes. here's the part of code: …

Member Avatar for skorm909
0
207
Member Avatar for Kirielson

Here's my problem, I am getting a bad access on a shared memory line on my producer/consumer program: [CODE]Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0xffffffff 0x00001db0 in main () at Project3.c:120 120 memset(buf, 0, BUFFER_SIZE); [/CODE] [CODE] int BUFFER_SIZE = 200; int *buf; [I]Some …

Member Avatar for Kirielson
0
161
Member Avatar for atramposch

I wrote this code to find the mode of an array of values. [CODE]double mode (double * array, int numItems) { int j, i, maxRepeats = 0; double mode; for(i = 0; i < numItems; i++) { j = 1; while(array[i] == array[i+j]) { ++j; } if(j > maxRepeats) { …

Member Avatar for Adak
0
110
Member Avatar for abarkwith

Hi, I'm relatively new to programming and would like to know how to suspend a c++ program until another program has created a certain file in linux. While it is waiting it needs to be using a minimal amount of processing power. Hope that made sense? Cheers, Andy

Member Avatar for nezachem
0
58
Member Avatar for comp_sci11

I'm trying to create a tree using C and print its tree traversals(preorder,inoreder,postorder) so i decided to start creating a tree first. My program accepts a characters in preorder but it doesn't print the data I entered. Could someone help me? [code] #include<stdio.h> #define MAXNODES 26 void push(); void pop(); …

Member Avatar for ankitcuul
0
201
Member Avatar for sh4rif

Hello every one! i want to create something like this (show at the bottom of this message as an attachment) but i've no clue how to create this digital payrmid. can anyone please help me with the code please? thanks for your help in advance cheers sh4rif 1 1 2 …

Member Avatar for Sgouros
0
93
Member Avatar for moroccanplaya

so far the user can select a file that he want to open to be copied, is there a way of letting the user selecting multiple files to be copied to one file? i was thinking of looping around asking the user to add another file if the user wanted …

Member Avatar for moroccanplaya
0
95
Member Avatar for svampizen

Hello Im new with c++ but I'am trying to make a space invaders game.... This is a loop that is shooting... [CODE] if(skott1aktiv) { masked_blit(skott, screen, 0,0,skott1x,skott1y, 32,32); skott1x+=skott1dx; uppdatera= true; if(skott1x>639 || skott1x<0) skott1aktiv=false; } rest(10); } [/CODE] Does anyone know how to make the shoot go up instead …

Member Avatar for alexchen
0
50
Member Avatar for bflack

delete(int list) { int i, j, row; char temp_last[max], temp_frst[max]; clrscr(); gotoxy(1,21); printf("Delete Data"); printf("\n-----------------"); gotoxy(1,23); printf("Last name : "); gets(temp_last); gotoxy(1,24); printf("First name : "); gets(temp_frst); /*for(i=0; i<=list; i++) { if(stricmp(record[i].last_name, temp_last)==0 && stricmp(record[i].frst_name, temp_frst)==0) { for(j=i; j<list; j++) { temp_last=record[j+1].last_name; /*<------Error on this . line */ temp_frst=record[j+1].frst_name; record[j].last_name=temp_last; …

Member Avatar for Shankye
0
193
Member Avatar for amari ♥

i need help with the following: make a program that would display the nth of the fibonnaci sequence. 1 1 2 3 5 8 13 21 34 55 ... n implement it using both iteration and recursion.

Member Avatar for Shankye
0
156
Member Avatar for amari ♥

i have this code and its output is 54. my question is, can someone please explain to me the process of getting this certain output, which is said to be 54. thank you. :) [CODE]#include<stdio.h> #include<conio.h> int sumS (int n, int m); void main () { int x=2, y=5; clrscr(); …

Member Avatar for Shankye
0
143
Member Avatar for kapilsolanki84

suppose i hv 1 txt file in which i hv declared 1 path name of particular file. i wan to recall that file by using pathname from thaT particular file.say for eg: input file(path.txt) having pathname as "C:\\gp442win32\\gnuplot\\binary\\gnuplot -persist","w".now i wan to call this file in c code in order …

0
68

The End.