#include <iostream> using std::cout; using std::endl; int main(int argc, char* argv[])
[Code] ...
The only Problem I have is that I need to know how to open a command window at the folder containing the .exe file(this program), inorder to enter the program name or arguments.
I am trying to open a file and print the contents of the file to the terminal window. It works when I put the file right in the directory with the Solution but not if the file is out on my desktop and I use the full path. Here is the code:
#include <iostream> #include <fstream> #include <string> using namespace std; int OpenFile(){ fstream SampleFile;
I have created a MFC application on Visual c++ 2012. My computer work in Win 7 - 64bits. When I see many tutorial about making the executable file which is independent on .dll library (by changing Configuration Properties ->C/C++->Code Generation->Runtime Library ->Multi Threaded Deburg (MT/d)) the compiler becomes error then I can not get the result as tutorial on internet.
Is there any other way to make the .exe file for this?
I'm trying to write a program that opens a directory and for each file in directory,it creates a thread. Inside of the thread,it reads the numbers in file.(one number in one line)And then calculates the average of these numbers. I write something like this;
void *calculate(FILE *piece){ int a,k=0,s=0,ort; while(!feof(ayri)) { a=fgetc(ayri); s=s+a;
[Code] ....
When I run the programme,i get lots of errors like 'segmentation error' and some stuff about pthread_create. And I don't think the 'calculate' function is right.I don't know the right way to read numbers line by line.
There is only one thing I need here. When the paint program is opened I need it to automatically open it maximized. Other than that my code works perfectly for what I'm trying to build.
It has to be maximized so when a friend opens it after I send it to him, it auto maximizes and doesn't start drawing on his desktop.
#include <iostream> #include <Windows.h> using namespace std; int main() { system("start C:/Windows/System32/mspaint.exe"); FreeConsole(); Sleep(1000);
So I've been turning my programs into classes and I run into errors.
So this program is supposed to allow the user to open the file and either read or write to it.
I've omitted the read part from it as I want to attempt that on my own .
I get these compile errors:
fileclass.cpp:13: error: ISO C++ forbids declaration of ‘choice’ with no type fileclass.cpp:21: error: ISO C++ forbids declaration of ‘choice’ with no type fileclass.cpp: In member function ‘int file::choice()’:
I'm trying to develop a programme which, amongst other things, prompts the user to enter the filename which is to be opened. This is what my code looks like currently:
char filename[20]; FILE *myfile;
printf("Enter the full file name you would like to open:"); scanf("%s", filename);
[Code] .....
However, this only ever returns File Not Found - the file is stored in the same directory as the program, and I have tried looking up this issue online, to no avail ....
My program accepts strings, places them in a vector and then "bleeps!" out words of my choosing, in this case, "broccoli". But I'm having trouble keeping the output window open even with my Keep_window_open() implementation.
I have a list with 2 items in it. When I double click on item 1, I want to open Window1.xaml, when I double click on item 2, I want to open Window2.xaml...
The code below works for popping up a message box, or window for that matter. But I really need to get the Window1 and Window2 based on the clicking of the correct selected item in the list.
I want to create three files whose names are same but extensions are different. I have to take the name from user. I tried following code but it didn't worked ...
Code:
printf("Name of the file:"); scanf("%s",name); printf("Format of Input file:"); scanf("%s",ext); f1=fopen(name.ext,"r"); f2=fopen(name.dat,"w"); f3=fopen(name.src,"w"); f4=fopen(name.RMH,"w");
What I want to do is create a file that will ask the user to enter his info,n then store it in a text file The screen will ask the user if he wants to update his info. if he says yes then the screen will be cleared and the old info will be printed on the screen. The user will enter his new info that will be stored in a new file. My problem is that once the user finishes entering his input the program just closes D: and the rest of the program won't run.
Code:
int main() { string ans; ofstream Xfile("original.txt"); cout <<"Enter your name and address please"<<endl; cout<<"Press Ctrl+Z+Enter when you are done"<<endl; string name_and_street;
There is function written C++, that must be compiled to DLL. This DLL is linked to some CAD (computer aded design) tool, that has special interface for it.
I want to add to this function some GUI (graphical user interface). So the creation of a window is necessary.
I've tried already with Win32, but without success.
The problem is that CreateWindow function requires application instance handle, that is provided by Windows itself when window is created in "normal conditions".
I am a beginner with C++, taking a class right now. The lab this week is to create a user defined class and have it accesses in a separate .h header file from the main.
I think I'm finding my way through it, but I'm getting a complie error that makes no sense to me:
I'm trying to create a GUI with Open graphics Libraries.I have made a basic GUI that exits the program or shows the instructions if a option/Polygon is marked (A bigger one is behind them)But what I'm trying to do now is the following:
0. Start the direct access on the desktop 1. Screen: Press any key to continue 2. Select one option 2.1 Option one: Go to the circuit selection menu 2.1 Option two: View the instructions (Cleared) 2.1 Option three: Exit the game (Cleared) 3. Select a circuit 4. Go to the car selection menu 5. Select a car and start the race 6. Pause menu if Spacebar has been pressed
From the pause menu:
6.1. Go to the main menu 6.2. Restart the race 6.3. Exit
I know that it is OpenGL, but what i'm looking for is C++.How I could do that? What I have cleared is with IF but I'm looking for better alternatives.
This is a tutorial that I have gone through completely with success, but now I am trying to create a different project using the same sort of setup.
When I add my usercontrol to the MainWindow it has none of the buttons/TextBlocks on which I have put on the UserControls - It is just a blank box. What could be causing this?
I have changed the name of the project to [snip] because it has a company name in it...