Basically I am to create a program that will read two saved text files; one is [2x4] ~ (matrixA.txt) and another is [4x2] ~ (matrixB.txt). The program is supposed to read both text files, multiply them, and generate an output that will be saved as ~ (matrixC.txt).
C:UsersLeDerpHW1.c: In function `main':
HW1.c:27: parse error before `int' //Line 28
C:UsersLeDerpHW1.c: At top level:
HW1.c:34: warning: parameter names (without types) in function declaration //35
HW1.c:34: warning: data definition has no type or storage class //35
HW1.c:35: parse error before `for' //37
i have this program that i am undertaking.....this project needs to store customer details, edit them and delete them...now i am facing the problem of deriving a code to edit those details...
MY CODE
HTML Code: #include <fstream> #include <iostream> #include <string> using namespace std; int main () { int choice [1]; string name;
I want to make a program that opens a text file and checks the usernames listed in the text files to see if the names are registered on a site such as twitter. How easy would this be to make, what things would I need to know?
I am supposed to read(scan) data from a folder with multiple(21578) text files, and file names are numbered from 1 to 21578,and read each word that occurs in a text file, and count the number of times it occurs in the entire folder,i.e; in all the files how do i go about it? I've tried this so far..but it isn't working..
Is C# or any other programming language out there that can run like a program that has been installed on you PC? For example say i want my program to run Media player with a saved play list, run spotify, or run a search on the internet?
i am trying to doing my project what is: Diff - The program should compare two text files and list the differences, i.e. lines and columns of the beginning and the end of a given difference.
I want to make a program that can know the current time and create a new .txt file.For example if its Monday to day then when its Tuesday it crates a new txt file called Tuesday.I really don't know how to go about this.I know i will need to use the time.h library.
I'm writing a code obfuscator in C. Debugger shows no errors in the code, but the program crashes after compiling -- I'm guessing it has something to do with while loops or reading data from files.
Code: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> // list off all replaced elements typedef struct ReplaceList { char *from;// from string char *to;// to string (random)
I am trying to make a simple program, I would like it to be able to do the following, Write a program that opens two text files (input1.txt and input2.txt) for input .The program should write the followings in the two files. input1.txt:
This is the first line in input1.txt. This is the second line in input1.txt. This is the third line in input1.txt. This is the fourth line in input1.txt.
input2.txt:
This is the first line in input2.txt. This is the second line in input2.txt. This is the third line in input2.txt.
What would be the best way to go about doing this? I wrote the program below, but I don't think that it works.
#include <iostream> #include <fstream> #include <string> int main() { using namespace std; string input1;
I have been working on a program to read in a tab deliminated text file of xyz coordinates of atoms/particles and store the values in three seperate arrays. This is my code so far:
Code:
#include<stdio.h> #include<stdlib.h> void fileinput(FILE *ifp) { int N, column, atom; int c; column = 1;
[Code]...
Supposedly this should assign the values in the text file to the cooresponding arrays but when I run the code on a simple test file all I get is:
Code:
$ ./input.o -i ./test.txt Atom one coodinates x 0.000000, y 0.000000, and z 0.000000 Where test.txt is: Code: 1.0000 2.000 1.5 3.0000 5.000 1.4 4.0000 3.000 1.3
I have a .txt file that contains, together with a few characters, columns of values that I want to save in different files like is written in the program (file 1, file2, file3 - a with x, b with y, c with z). The pattern of the source text file is like this:
Until now I could manage to split the files, but the output gives me only zeros. First the program count the number of lines of the read text file, then it should display the desired columns of double values in three other .txt files.I've got for the three .txt files columns like this:
Write a program to read in a sequence of examination mark from a text file named as input.txt and produce the mean, and standard deviation of the marks. Your program should also produce a bar chart for each grade where the range of mark is given as below.
GradeMarks Range A80-100 B70-79.9 C50-69.9 D40-49.9 F0-39.9
Output the result to another text file named as output.txt.
I am writing a piece of code that requires me to display the last 1000 lines from a multiple text files (log files). FYI, I am running on Linux and using g++.
I have a log file from which - if it contains more than 1000 lines, I need to display the last 1000 lines. However, the log file could get rotated. So, in case where the current log file contains less than 1000 lines, I have to go to older log file and display the remaining. For e.g., if log got rotated and new log file contains 20 lines, I have to display the 980 lines from old log file + 20 from current log files.
What is the best way to do this? Even an outline algorithm will work.
I am trying to read two matrices from individual .txt file, and later trying to multiply them. But I am unable to succeed.
Here is the code.
#include<stdio.h> #include<stdlib.h> #include<stdbool.h> // Here starts the main int main() { // The two input values FILE *inputFile1; FILE *inputFile2;
[Code] .....
I am able to get only the first values as the output. The first matrix is 5x3, and the second one is a 3x3 matrix.
Matrix 1 1 2 3 4 5 6 7 8 9 10 11 12
Matrix 2 1 2 3 4 5 6 7 8 9
The output which I am getting is
Enter File name of matrix #1 - with extention - : matrix1.txt Enter File name of matrix #2 - with extention - : matrix2.txt Rows1 = 1 Cols1 = 2 Rows2 = 1 Cols2 = 2Cant multiply those two matrices
I am having a structure called matrix as shown below to represent a matrix your read from a text file.
struct matrix { double mat[30][30]; //content of the matrix mat int row; //number of row in the matrix mat int col; ////number of col in the matrix mat };
Declare 3 variables of structure matrix, m1, m2 and m3 in main to be used as describe below.
Task:
1.Write a function void readFile(char *filename, matrix *m) that will read a matrix from a text file and copy to the structure matrix m.
Is possible read text form keyboard using read() function? or which is best way in ansi creplace input command form basic language. for numbers and text...
I am writing a program to hide files behind other files using Alternate Data Streams in Windows NTFS file systems.
The program is as follows:
Code:
#include <stdio.h> #include <stdlib.h> int main(void){ char hostfile[75], hiddenfile[75], hiddenFileName[15] ; printf("Enter the name(with extension) and path of the file whose behind you want to hide another file: "); scanf("%75s", hostfile);
[Code]...
The complier is showing error as "Extra Perimeter in call to system" but I am not getting where?
I need to write a widget that will implement some matrix functions using data from a text file. The input data will be spreadsheet like and fully determined with complete rows and columns. I need to do the following,
1. populate a data structure with the input data (double) to create matrix x 2. transpose the input data matrix x to create x' 3. multiply x * x' to create a square matrix x'x 4. take the determinant of x'x
This is pretty standard linear algebra, but not something I have done in cpp before. Implementation such as the best data types to use to store each of the three matrices, how they are sized, and what library functions may be available for the matrix functions like transpose, multiply, determinant, etc.
I will be removing each data row from the initial input to observe the effect on the determinant in case that has any effect on program design.
I'm trying read a binary file. A binary files is continued with bytes(ascci characters). and the 1st position is the position 0(zero).
I'm trying read just some values from ICO file:
- the 3rd value is in 4th-1 position(number of icons); (See the table: [URL] .... ) - the with is the (numberoficons*16) + 4 (the 16 is the Entries structure size) position; - the height is the (numberoficons*16) + 4 + 4 (the 16 is the Entries structure size) position.
now see the code:
int iconwidth; int iconheight; int iconcount; FILE *iconfile = fopen(filename.c_str(), "rb");//open the file fseek(iconfile,4-1,SEEK_SET); //put the file in position 6(the position starts from 0) fread(&iconcount,sizeof(char),2,iconfile);//get 2 blocks with char size(2 bytes).. i'm getting the number of icons
I am using dir object from dirent.h to read files of a folder. The code I am using in order to read all data is the following:
vector<string> directories;
DIR *pDIR; const char * c = path.c_str(); struct dirent *entry;
[Code]....
I am wandering when I am trying to read two times the files of the same folder, it will be stored with the same order or every time I ll read in folder it ll return different file order?