15,550 Topics

Member Avatar for
Member Avatar for trick

I have this C program which produces a .csv [comma separated variable] file, from an uploaded .txt file. The uploading part and writing the .csv file went fine, however, my problem is that the file can't be downloaded by the user. Can you tell me what's wrong missing with my …

Member Avatar for peterpollen
0
139
Member Avatar for Crushyerbones

I'm trying to do something similar to this: [code] int output_type=1 if (output_type==1) char real_out[7]="binary"; else if (output_type==2) char real_out=[6]"octal"; else if (output_type==3) char real_out[8]="decimal"; else { char[20]real_out="This REALLY shouldn't have happened.\n";} } [/code] I know the coding is kinda messy but I basically want the variable "real_out" to contain …

Member Avatar for Crushyerbones
0
111
Member Avatar for ITbull

Hi i'm getting an error CODE : ERROR: E2356 TEXTSORT.C "TYPE MISMATCH IN REDECLARATION OF 'SWAP' and i am exhausted trying to fix it...if you could help me please i would appreciate it. [code=c] void sort(char* string_array[], int length) { int i; int exchange_done; do { exchange_done = 0; for …

Member Avatar for mitrmkar
0
132
Member Avatar for os.hacker64

I realize that kprint takes a pointer as a parameter. I don't understand how it loops through each character when you do something like kprint("HELLO WORLD"); Can you really just increment *s to get to the next char like: s++; char c = *s;

Member Avatar for Ancient Dragon
0
92
Member Avatar for shaka2

[code=c++] #include<iostream.h> #include<stdio.h> #include<io.h> #include<conio.h> #include<math.h> #include<stdlib.h> #include<string.h> void minmax(int); float max[13],min[13],array[13][270]; void main() { FILE *fp; char line[100]; char symptom[10]; float f; fp=fopen("input.txt","r"); int i=0,j=0,k,l=0; int rw_cnt = 0; int cl_cnt = 0; int len; while(!feof(fp)) { //i=0; //l=0; fgets(line,99,fp); printf("%s \n",line); // getch(); rw_cnt++; // len=strlen(line)+; // line[len]='\0'; …

Member Avatar for Ancient Dragon
0
235
Member Avatar for knight fyre

I'm experimenting with fgets because I heard it's better for dealing with memory buffer overflow but I am not sure of the [B]sizeof[/B] component and how to the [B]stdin[/B] part helps it to work. Is [B]METHOD 1[/B] or [B]METHOD 2[/B] in the following code the correct implementation of [B]sizeof [/B]and …

Member Avatar for knight fyre
0
165
Member Avatar for s88

help please, i have to generate a funciton which generates the squareroot of any real number! I don't know what else I can do :( [code] #include <stdio.h> #include <math.h> double squareroot(double number) { double x[20]; int count,count2; x[0] = 1; for (count = 0;count <= 20;count++) { while ((abs(x[(count2)-1]) …

Member Avatar for gxm
0
154
Member Avatar for nelledawg

Hi guys, Ok so once again, I have pretty much the whole code written, but something is not working right! When I run it and select "add record", it works up until the user inputs price, then it just prints a ton of numbers and basically crashes. Please help me …

Member Avatar for WaltP
0
130
Member Avatar for heshangho

hey guys How do you write and statment to input the values for the elements of array(x[i][j]) from the terminal? Do we have to use a for loop?

Member Avatar for VernonDozier
0
48
Member Avatar for midimatt

Well another problem, sorry for constantly asking. My program is coming along well i think, it creates the file writes the data to it but it crashes when i try to view the information. i'm not sure if its an error with my loaddata() function or my viewcharacter() function [code=c] …

Member Avatar for midimatt
0
151
Member Avatar for nelledawg

Hi guys, Okay so lets say I've got a functions program that asks the user for a product quantity, the cost to make the product, and the selling price of the product. I want to make a function called total() to receive either the quantity and cost, or the quantity …

Member Avatar for nelledawg
0
154
Member Avatar for heshangho

hey guys How do u define a 2by 5 array..is it mean int t [2][5].. how do u figure out how many elements in the array?

Member Avatar for heshangho
0
102
Member Avatar for wonder_laptop

i wrote a program called trivial.c that takes an integer "time" from the command line and does nothing but loop for 5 times and sleep for "time" seconds in each iteration. the loop looks something like this : for(i=0; i<5; i++) { sleep(time); } then a file trivial.data that contains …

Member Avatar for peaceful_soul
0
97
Member Avatar for midimatt

Hi Again, Well i'm bored and i've decided to do some coding just for practice and i've decided to work on a text based RPG, its only going to be basic due to my own knowledge but i think its doable. unfortunatly i've come accros a problem already and i've …

Member Avatar for WaltP
-1
370
Member Avatar for remcob

Hello, When I have a created a socket (sd) connection and opened a file (fd). How can I send over a file? Create a buffer (char buf[BLOCK] ????)and send over block by block or so? And if so, what is most efficient block size? Cheers!

Member Avatar for remcob
0
90
Member Avatar for wonder_laptop

hello guys, [code=c] #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <errno.h> void main(int argc, char *argv[]) { int status; char *prog = argv[0]; char *new_cmd = "/bin/echo"; char *cmd_args[] = {"echo", "hello", "world", NULL}; char *cmd_env[] = {NULL}; status = execve(new_cmd, cmd_args, cmd_env); /* * execve does not return unless …

Member Avatar for wonder_laptop
0
120
Member Avatar for ETS

hi, I'm new to the forum and I hope that i have put this in to the right section... anyway here is my problem, i have to build an electronic device for a school project ( we have to build a device at the end of schooling to show our …

Member Avatar for ETS
0
96
Member Avatar for danibootstrap

Hello,I have this C program which is equivalent to the com port.Useful for data logging from the sensors.It consists of the .c file and two header files cport.h and xmodem.h .The code compiles fine but there are lot of linker errors.I tried a lot ,pulled my hair but no use.Can …

Member Avatar for danibootstrap
0
965
Member Avatar for Cbeginner_us

Please I need some help in C. I have a file with ".dat" format, how can i load it in C, into a variable, so that I can use the data for some math calculations later on? thank you.

Member Avatar for Ancient Dragon
0
124
Member Avatar for sjgriffiths

hello I am trying to open a file which exists on my local PC using fopen the file is located in c:\B2B Data\files and is called file.txt When i put the above into a variable called filename, i cannot open it ie char filename[27]="c:\B2B Data\files\file.txt"; i then issue an fp …

Member Avatar for Ancient Dragon
0
87
Member Avatar for emremr

[url]http://www.me.metu.edu.tr/me310/section3/homeworks/homework2/m310s08h2.pdf[/url] hello guys can anyone help me about my homework i couldnt copy paste the question but i gave the link its about Gauss elimination with partial (row) pivoting by c programming. i need the source code as soon as possible.

Member Avatar for midimatt
0
227
Member Avatar for sapan kumar
Member Avatar for Colin Mac
0
35
Member Avatar for danibootstrap

Hi, I have just started using sensors and I did the coding for ADC.I am able to get the ADC values using the Hyperterminal.But I want to build real time graphs using C in DevCpp (Windows).Any sample code which will help me read the data from the serial port (9600-8-N-1) …

0
70
Member Avatar for liukinhei

Hello, I am writing a c program to Prompts the user (altogether 10 times) to enter a word not longer than 9 characters. And it needs the modification of each word by changing lower case to upper and then the reverse of the word is concatenated with the word.FInally , …

Member Avatar for midimatt
0
111
Member Avatar for fiz hafiz

what about this one?? thanx, but when i've compile the program, it does not work for the error, 'com' uses undefined struct 'registration' and lots more [CODE=c]#include<stdio.h> #include<ctype.h> #define FILENAME "computing" void proceed(struct registration com, int matric); void again(struct registration com); struct registration { char code[10]; char subject[100]; int credit; …

Member Avatar for WaltP
0
87
Member Avatar for Samadhi69

I'm familiar with java and have made many data structures there. Not so much in C and to complicate it the professor wants the LL set up LISP style. I know I need to iteratively sort the tail then insert, but the setup we were given lacks some of the …

Member Avatar for WaltP
0
103
Member Avatar for midimatt

Hello again, i'm trying to make a program that draws a cube on the screen using data inside of a .txt file, this is the code that i've got so far, it compiles and runs but doesnt actualy display anything and i'm not really sure why. its probably something simple …

Member Avatar for midimatt
0
2K
Member Avatar for purepecha

/* I'm new on c ++ and i been strugling with this problem. create the special functions used by this routine and write the functions so it can be used by the main routine as shown*/ [code=c] #include <stdio.h> #include <stdlib.h> Void powerArgs(int *parmA, int *parmB) { int temp = …

Member Avatar for Ancient Dragon
0
129
Member Avatar for Phanta

Good evening, I'm basically doing a program that does something like this: You enter two integers -4 and 6 which represent intervals Then the loop does this: (-4) + (-3) + (-2) + (-1) + 0 + 1 + 2 + 3 + 4 + 5 + 6 After that …

Member Avatar for Phanta
0
93
Member Avatar for jeffige

Following along a C tutorial, I entered this code. When I compile and run, it aks for my age, which I enter. But it doesn't display any of the 'if' or 'else' statements. So I hit enter and the window closes. Is there a trick or am I entering the …

Member Avatar for Ancient Dragon
0
129

The End.