Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Example:
#include <iostream>
int main() {
return 0;
}
I want to know total number of LOC, including everything included from iostream.
You could use GCC's -E-option, which does preprocessor only compilation, so all makros and includes will be expanded and the resulting code is sent to console output. Feeding this into a word count / line count should give the desired result:
gcc -E main.cpp | wc -l
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 days ago.
Improve this question
I am creating my own compiler for a college class. The current project is asking me to edit a bison file (parser.y) to accept command line arguments to the function header, such as:
function main a: integer, b: integer returns integer;
Using the execution method (using linux): $ ./compile < test.txt 2 4, a
would have a value of 2 and b would have a value of 4.
I don't know how to modify a bison file to accept command line parameters. Any advice? (Below is the function heading in my parser.y file)
Parser.y Header Snapshot
I've tried searching online for explanations like yy_scan_strings, but don't seem to be making progress.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I've noticed that when my fortran code is running, the executable generates several temporary files with the name patter fort* where * is a 6 digit alpha numeric. The number of files generated corresponds to the number of threads the program is running on. The files are cleared once the program exits.
What are these files? And what is stored in them?
Edits: The program has no commands that generate these files.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I did various implementations but they take a long time
Can anyone give us the best implementation?
For example, add a ten-digit number to the end of a string
I did not find a good answer on the Internet
#include <iostream>
std::string a="string";
long n=1703705707;
a.append(std::to_string(n)); //becomes "string1703705707"
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Can you please help me with how to check CPP files in a project for functions exceeding 'n' number of lines using Clang-Tidy?
You can use the readability-function-size check and set the LineThreshold parameter to your n value.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am a fairly new C++ programmer and I am trying to set up a program that moves 2 files into a different location. How do I do this?
Under Windows, there is an API just for that purpose, the MoveFileEx() function.
To use it, start with:
#include <windows.h>
And then you can simply do something like this:
BOOL result = MoveFileEx("C:\\dir\\myfile.txt", "D:\\another\\directory\\output.txt", MOVEFILE_COPY_ALLOWED);