15,552 Topics
| |
I'm working on a matrix addition/multiplication/transpose/inverse program and after entering the values of matrix A, I don't know how to call these values. [CODE] int setMatrixA(int r1, int c1, int i, int j){ printf(" Enter the number of rows:\n"); scanf("%d", &r1); printf(" Enter the number of columns:\n"); scanf("%d", &c1); for(i=0; … | |
i have to create a calculator which i have but i cant get it to run yet. i keep getting "12: error: subscripted value is neither array nor pointer" i'll highlight it for you. if anyone can fix it please do thank you. [CODE=c] #include<math.h> #include<stdio.h> int main() { float … | |
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 … | |
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 … | |
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 … | |
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; | |
[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'; … | |
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 … | |
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]) … | |
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 … | |
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? | |
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] … | |
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 … | |
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? | |
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 … | |
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 … | |
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! | |
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 … | |
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 … | |
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 … | |
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. | |
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 … | |
[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. | |
i want to know how to generate a sine wave using sin() function | |
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) … | |
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 , … | |
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; … | |
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 … | |
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 … | |
/* 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 = … |
The End.