Computer programming vs algorithm?
An algorithm describes the finite procedural steps required to solve a problem. Algorithms are typically written so humans can easily understand those steps. Computer programming is the means by which a computational problem is converted into executable code. This often entails the development of algorithms which must be converted from the human-readable form into native machine code, typically using high-level programming languages to produce the abstract, human-readable source code, and compilers or interpreters to produce the machine-readable code.
How do you create our own header file in c plus plus?
1. open word processing software. (Notepad or wordpad)
2. Write the desired function for the header.
3. Save it with .h as extension. Like "myheader.h"
4. Run cpp.
5. It should be like this... #include "myheader.h" 1. A header file is not any different to the compiler than ordinary code
2. Its just a convenient way to have commonly "included" code
3. It is primarily used for prototypes, not actual code, such as declaring an API
4. Be care with redeclarations. The #ifdef / #endif pragmas can help
5. The location of "user defined" headers is different than system headers
6. They are normally in the build directory, whereas system headers are elsewhere
In computer science, runtime or run time describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). The term is also used as a short form when referring to a runtime library (without a space), a program or library of basic code that is used by a particular computer language to manage a program written in that language while it is running. A runtime environment is a virtual machine state which provides software services for processes or programs while a computer is running. It may pertain to the operating system itself, or the software that runs beneath it.
How do I uninstall your operating system to install a new system?
There is no uninstaller for an operating system. To remove an OS, simply format the partition that holds the operating system. If you use a boot manager to choose between different operating systems the software should automatically detect missing operating systems for you.
Which CPU scheduling Algorithm is used by Windows XP OS?
In the past (and perhaps currently as well) it has used round-robin, at one time 1 second but since updated to .1 seconds. It may also have other features such as preemptive abilities.
Priority fair scheduling.
How do you search the given word in all files from the directory in java?
The program below will search all non-directory files in the starting directory. If you want to search all subdirectories, you'll have to modify it to recurse a bit.
Note that this will also only do plain text searches of files. It will most likely not find your string in a MS Word .doc file.
Also note that this will not find multiple-line search strings, since it reads and checks one line of the file at a time.
{
final String dirName; // path of directory you want to search
final String str = ""; // string to search for
final File dir = new File(dirName);
for (File f : dir.listFiles()) {
if (!f.isDirectory()) {
System.out.println(f + ": " + fileContains(f, str));
}
}
}
// returns true iff f contains str
private static final boolean fileContains(final File f, final String str) throws IOException {
final BufferedReader in = new BufferedReader(new FileReader(f));
String currentLine;
while ((currentLine = in.readLine()) != null) {
if (currentLine.contains(str)) {
in.close();return true;
}
}
in.close();
return false;
}
How can create a exe file in c?
An 'exe' extension file is created by a compiler that translates source code to machine code, usually in a Windows environment.
An executable program can open any file (including other executable files) by using the standard file API calls with a binary open option.
Unless you are doing something very specific with executable files it doesn't make much sense to read in an executable file from another executable file or program.
What you call Programs that come into a computer system disguised as something else?
Normally its called a Trojan or malware or spyware, that's if it installs by ti self say for instance while surfing the internet. If its installed by a person withoout your prior knowledge i do not know waht you call it then hope this will help you.
What computer programs are you familiar with?
Assuming you were asked the question originally, and are looking for an answer, there is nobody more qualified than yourself to answer that question; it is a question about your personal ability.
I am personally familiar with hundreds, if not thousands, of software applications, commands, operating systems, and so on, ranging from the mundane to the esoteric. My knowledge generally encompasses Microsoft-based and Linux-based Operating Systems, and many of the common multimedia, administration, servers, programming, file sharing, and office suite applications they have to offer. In fact, it would take me several hours just to compose a comprehensive list of software I am familiar with.
Random access and sequential access file in vb 6.0?
To access a particular data item in a sequential file, you need to read in all items in the file prior to the item of interest. This works acceptably well for small data files of unstructured data, but for large, structured files, this process is time-consuming and wasteful. Sometimes, we need to access data in non-sequential ways. Files which allow non-sequential access are random access files.
How do you install Turbo C plus plus on Windows XP?
Borland Turbo C++ is a 16-bit DOS implementation of C++. As such it cannot be run natively on 32-bit architecture, including Windows XP. Emulation programs such as Dosbox can be used to emulate a virtual 16-bit environment, however you will need to install a slightly modified version of Turbo C++ that is capable of running within this environment.
What is a handle in Windows Programming?
A handle is a reference for the operating system. It does not have the semantics of a programming reference but what it does do is allow the system resources to know what you are referring to when it is passed in an API call. Usually, the HANDLE is wrapped in an instance of a class. CWnd is a good example, it contains an HWND which is a handle to a window. You can do this. CWnd *pWnd = CWnd::FromHandle(hWnd) Note: that CWnd::FromHandle(hWnd) is static and does not require an instance. It will pass you back the wrapper that the hWnd is wrapped by. Well not quite! If the handle is not actually wrapped by an object it will create one AND IT WILL ONLY BE TEMPORARY.So use it the once then throw it away. It can create the instance because the hWnd has enough information in its struct for windows to instantiate a CWnd object. It does not add it to the handle v object table, so it is only temporary. The HWND is in fact a kernel object and theres more ? HWND (CWnd and CWnd-derived classes) HDC (CDC and CDC-derived classes) HMENU (CMenu) HPEN (CGdiObject) HBRUSH (CGdiObject) HFONT (CGdiObject) HBITMAP (CGdiObject) HPALETTE (CGdiObject) HRGN (CGdiObject) HIMAGELIST (CImageList) SOCKET (CSocket) (Should have been HSOCKET?) + others. I am not sure if all of these would pass back a temporary object if required. ::GetDC(hWnd) will get you a hDC from an hWnd but it will be temporary, probably better to use the CDC claa. It may be a fundamental requirement for windows programming? For a proper explanation look up google with this "Inside MFC: Handle Maps and Temporary Objects"
What is the best way to merge partitions on your hard drive?
One of the safest ways is to purchase a software program, e.g. Partition Magic, which can do this without destroying any of the data that may be on the partitions.
Better way
The safest way is to backup all your data. format HD and repartition with fdisk. Then install your programs and restore the data.
Although there are many programs to partition HD without lose data, nobody will recommend use them without backup your data. And if you backup all your data why not format your HD and reinstall programs - that way all your programs will run faster. If you don't have the time to reinstall or the original programs discs, You still must backup all your critical data, and this exist in many places on your HD, not just in "My Documents" folder, like Outlook data. So be care and lot of luck.
---- In Linux: After MUCH frustration, digging, trial-and-error, I have answered my own question.
My problem, as you may recall, was that I could not delete or resize two "unallocated partitions on my hard drive. All the options (unmount, resize, delete, etc.) were grayed out. I could not unmount them because they were in use.
The answer was to download the GParted LIVE CD from: http://gparted.sourceforge.net.
I simply inserted the GParted LIVE CD, rebooted, and -- voila! -- I could move, resize, and delete all my partitions at will! IMHO, the GParted utility is much easier to use then Partition Magic, and best of all, it is FREE!
I hope this post can help others with a similar problem.
lwcary
----
Write a Java program that computes the summation of 1 to n?
Increment your counter two at a time. Example, for n = 100:
n = 100;
sum = 0;
for (int i = 1; i <= n; i+=2) sum += i;
Another option (less efficient) is to loop through ALL integers, and check whether the number is odd:
n = 100;
sum = 0;
for (int i = 1; i <= n; i++) {
if (i % 2 == 1)
sum += i;
}
Or:
if (min%2==0) min= min+1;
if (max%2==0) max= max-1;
sum = ((max-min)/2 + 1) * (min+max) / 2;
How do you create window with c?
It is not possible to create a window with C as the C language does not specify any standard libraries for doing graphical programming. It is possible to create a window with C and one of the many graphics libraries that have been written since C was created. For example, using the Gtk+ library: #include #include int main (int argc, char *argv[]) { GtkWidget *window; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_show_all (window); gtk_main (); }
What is the command prompt that directs output from a program to a file?
You have to include one more file:
#include <fstream.h>
//Which is responsible for operations with files
//Then call a variable of stream type
main ()
{
ofstream out_stream;
//And use out_stream like you use cout
int data_X;
...
data_X >> out_stream;
...
}
In early computing days, computers were expensive, and so to absorb the cost, a big computer would be shared across many people who would pay for time-sharing (such as one hour units). The limiting factor, money, would be the only reason why someone might use a time-sharing system. For that individual, their use of a computer is so infrequent that they cannot justify purchasing an actual computer, or their current hardware is inadequate for their needs, so they lease time on a more powerful system to play games, process data, etc.
Time sharing is most frequently found today in terms of "virtual machines", such as virtual servers or virtual desktops that are accessed remotely through a less powerful system or even a thin client (a keyboard, mouse, and monitor connected to a very small computer with only enough RAM and CPU power to access the remote desktop). It is projected that as computer networking and virtualization becomes more powerful, time-sharing will soon replace or heavily supplement PCs and single-user workstations.
What is modularity in computer programming?
Every program requires at least one module. While it is possible to write an entire program in just one module, the larger the program becomes the greater the cost in maintenance. That is, whenever we make any changes to that module, the entire program has to be recompiled. By splitting the program into modules, only those modules that have changed need to be recompiled.
Modular code also makes it easier to organise code because each module represents a particular aspect of the program. Ideally each module should be self-contained but there will inevitably be cases where one module is dependant upon another. Indeed, there may be several modules dependant upon the same module. However, this is an advantage rather than a disadvantage because modular code makes it much easier to write re-usable code; code that can be used in more than one program. In this way we do not have to re-invent wheels writing duplicate code, we only need to write the code once and use it wherever and whenever it is required.
I presume you are asking for an example of a Brief command prompt? First go to a CMD shell by selecting the windows button in the bottom left corner and typing CMD after "RUN". A black screen will appear where you can enter any prompt such as: ipconfig - IP confirguration
Dir - directory listing
When you double click your c drive it says application cannot be run in Win32 mode?
I also had this problem few dayz before and it just made me mad, i was felt into that situation that i even cannot format ma windows so, finally i researched upon it and found the solution :-
1. Go to your first drive for example c:/ and delete the hiden file autorun.inf also delete from recycle bin
2. Then create a folder name autorun.inf after delete first one as soon as possible
3. do the same thing with all of your drives
4. Log off ur PC your PC
bingo ! you have your PC recovered back
Why is the purpose of header files in c programming?
Header files allow programmers to separate interfaces from implementations. Typically, a header file contains the declaration of a single class or a group of related classes or functions, or both. The definitions are typically placed in a corresponding source file (which must include the header), although inline functions are often defined in the header itself, while incomplete types such as template classes and template functions must always be defined in the header.
Although you could place all your code in a single file, header files make it easier to re-use common functions and classes from other programs. You can also build libraries of common classes and functions, each of which requires a header (the interface) that must be included in your source in order for your programs to be able to link to those libraries. Thus headers are an aid to modularisation and re-usability, thereby reducing the need to write duplicate code.
Your question is confusing. If you need to change the style of the text, you need to use style/CSS.
Program to copy one file into another using command line arguments?
#include<iostream>
#include<fstream>
#include<algorithm>
#include<string>
int copy_file (const std::string& src_name, const std::string& dst_name)
{
// Ensure source exists for input.
if (!std::ifstream (src_name).good())
{
std::cerr << "The system cannot find the file specified.\n" << std::endl;
return -1;
}
// If destination exists (for input), ask to overwrite.
if (std::ifstream (dst_name).good())
{
std::string yn;
while (!yn.size())
{
std::cerr << "The destination file exists. Overwrite? [Y/N]";
std::getline (std::cin, yn);
if (yn.size())
{
switch (yn[0])
{
case ('Y'): case ('y'): continue;
case ('N'): case ('n'): return -1;
default: yn.clear();
}
}
}
}
// Try opening or creating the destination.
std::ofstream dst (dst_name, std::ios_base::binary);
if (!dst.good())
{
std::cerr << "The destination file could not be created or opened for writing.\n" << std::endl;
return -1;
}
// Definitely good to go.
std::ifstream src (src_name, std::ios_base::binary);
std::cout << "Copying " << src_name << " to " << dst_name << std::endl;
dst << src.rdbuf();
std::cout << "\t1 file copied.\n" << std::endl;
return 0;
// Note: both files close when they fall from scope...
}
int main (int argc, char* argv[])
{
switch (argc)
{
case (3):
return copy_file (argv[1], argv[2]);
case (2):
if (std::string(argv[1])!="/?")
break;
// strip the path and extension from the command
std::string command (argv[0]);
size_t last_backslash = command.rfind ('\\') + 1;
size_t last_period = command.rfind ('.');
std::string exe = command.substr (last_backslash, last_period-last_backslash);
std::transform (exe.begin(), exe.end(), exe.begin(), ::toupper);
std::cerr << "Copies a file to another location.\n\n"
<< exe << " source destination\n\n"
"source\t\tSpecifies the file to be copied.\n"
"destination\tSpecifies the filename for the new file.\n" << std::endl;
return 0;
}
std::cerr << "The syntax of the command is incorrect.\n" << std::endl;
return -1;
}
What is java jre and java jdk?
== == JRE includes (JVM ) java virtual machine and some other library files. That runs a java application. JVM - understand the corresponding byte code of a java class and make it ready for run. The Java Runtime Environment (JRE) is an implementation of the JVM (Java Virtual Machine) that actually executes our java programs.
The Java Virtual Machine (JVM) is created, like a separate program, whenever a java program is executed. The JVM essentially runs between the computer and the java program. Java is designed so that any java program can run on any machine. This is because the JVM will interpret the Operating System independent java code and execute the commands needed for the particular Operating System you are trying to run the program on at the time.
Java Program --- Execute some command ---> JVM --- Translate the command for this computer ---> Computer
Java Virtual Machine (JVM) A Java Virtual Machine (JVM) is a set of computer software programs and data structures that use a virtual machine model for the execution of other computer programs and scripts. The model used by a JVM accepts a form of computer intermediate language commonly referred to as Java bytecode. This language conceptually represents the instruction set of a stack-oriented, capability architecture. As of 2006, there are an estimated four billion JVM-enabled devices worldwide. Java Runtime Environment contains JVM, class libraries, and other supporting files. It does not contain any development tools such as compiler, debugger, etc. Actually JVM runs the program, and it uses the class libraries, and other supporting files provided in JRE. If you want to run any java program, you need to have JRE installed in the system