C++ :: No Compile Errors But Blank Screen On Execute?
Oct 23, 2013
I'm working on a Hash Table implementation and after fixing all the errors and finally getting it to compile and link correctly, I am met with a black screen upon execute.
main.cpp
#include <stdio.h>
#include <string.h>
[Code]....
I tried inserting a debug statement in the main() function to see, and it wouldn't even print out the message "debug me" on the screen.
I am using Code::Blocks on Windows with the mingw32-g++.exe compiler. Here is my build log:
mingw32-g++.exe -Wall -g -c D:MediaDesktopHashElement.cpp -o objDebugElement.o
mingw32-g++.exe -Wall -g -c D:MediaDesktopHashHashTab.cpp -o objDebugHashTab.o
mingw32-g++.exe -Wall -g -c D:MediaDesktopHashmain.cpp -o objDebugmain.o
mingw32-g++.exe -Wall -g -c D:MediaDesktopHashStudent.cpp -o objDebugStudent.o
mingw32-g++.exe -o binDebugHash.exe objDebugElement.o
objDebugHashTab.o objDebugmain.o objDebugStudent.o -mwindows
Output size is 1.06 MB
Process terminated with status 0 (0 minutes, 2 seconds)
0 errors, 0 warnings (0 minutes, 2 seconds)
View 11 Replies
ADVERTISEMENT
Jan 23, 2013
this is my C# code
System.IO.Directory.SetCurrentDirectory
("C:/Users/fahime/Documents/Visual Studio 2010/WebSites/MyWebSite/UserFiles/ProblemAnswers/");
Process.Start("cmd.exe", @"/k ""C:Program Files (x86)Microsoft Visual Studio 10.0VCvcvarsall.bat"" x86");
[Code] .....
I want to compile my cpp code file with visual studio cmd
View 3 Replies
View Related
Apr 28, 2015
I'm making a small MFC module that should generate a report (formatted using HTML) and then display it for a user on schedule at 8:30 AM every day. Pretty straightforward stuff.
I compose my report and then save it as a local HTML file in the CSIDL_APPDATA folder. I then use the following calls to display it using the default web browser (Internet Explorer in this case):
Code:
//Error checks are omitted for brevity
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
ShellExecute(NULL, NULL, strSaveFileTo, NULL, NULL, SW_SHOWNORMAL);
This module is run on schedule from the Task Scheduler. (The task is set up to run when a user is logged on, which is all the time for that PC. It is never turned off, put to sleep, etc. That computer has only one user that is never logged off either.)
This works perfectly fine when I test it by setting the task a minute or so in the future. But when the actual task is supposed to run at 8:30 AM, when the user wakes the screen all they see is a blank Internet Explorer page. (Note that if someone refreshes that page by hitting F5, only then my report is shown on the screen.)
So I started looking into it:
1) I checked that the file is properly saved (before calling ShellExecute) by reading it back and by comparing it with the original HTML markup that I saved earlier. It's all correct there.
2) I then checked the power saving options. That computer is set up to show screensaver after 5 minutes and to turn off screen after 25 minutes.
3) The web browser that causes this issue is IE version 11, with the latest updates installed. The operating system is Windows 7 Professional.
And why is IE showing a blank page only when computer is running unattended?
View 14 Replies
View Related
Aug 4, 2014
Here's the source code from "battle.h" (which should probably be renamed to "animal.h")
Do you think I made my errors here or in one of the many other headers or cpp?
#include "Identity.h"
#include "stdafx.h"
#ifndef battle_h
#define battle_h
int numbers1 = rand() % 5;
int numbers2 = rand() % 7;
int numbers3 = rand() % 9;
int numbers4 = rand() % 11;
[code].....
View 8 Replies
View Related
Oct 15, 2012
When trying to compile, I am receiving errors which I am assuming are pretty generic and common:
lin_interp.c:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
lin_interp.c:100: error: expected '{' at end of input
I am just trying to get the code to work for now. I have created a program similar to this which worked in C++, but the code isn't jiving in C.
Code:
// Lin_Interp.c : Defines the entry point for the console application.
//
#include "PACRXPlc.h" /* Include file applicable for all targets */
#include "ctkInitCBlock.h"
#include "string.h"
#include "math.h"
#include "stdlib.h"
#include <time.h>
#include <ctype.h>
#include <stdio.h>
/* Constants / #defines */
// Print-Out on console "XY LIMIT ARRAY" XYlim
[Code] .....
View 8 Replies
View Related
Feb 4, 2014
I am trying to build a VC++ project in Visual Studio 2010. [URL] ....
This project has a dependency on openssl libraries. How can I successfully build this project? How to add third party libs/dlls in a project.
View 1 Replies
View Related
Jul 7, 2013
I'm learning OpenGL 3.2+ with GLFW and GLEW.
I'm learning it through this series of tutorials [URL] but when I run the first code:
#include <iostream>
#include <cstdlib>
#include <GL/glfw.h>
#define GLEW_STATIC
#include <GL/glew.h>
int main() {
glfwInit();
glewExperimental = GL_TRUE;
[code]....
(Then i have the glew.h that is about 17000 lines of code)
I get this errors:
c:archivos de programacodeblocksmingwin..libgccmingw324.7.1........includeGLglew.h|84|error: #error gl.h included before glew.h|
c:archivos de programacodeblocksmingwin..libgccmingw324.7.1........includeGLglew.h|1793|error: 'GLchar' does not name a type|
c:archivos de programacodeblocksmingwin..libgccmingw324.7.1........includeGLglew.h|1804|error: 'GLchar' has not been declared|
[code]....
What I'm doing wrong?
View 12 Replies
View Related
Oct 30, 2014
I wrote a program to compress a file with gzip, which works fine. I also wrote a program to decompress the gzip file, which runs but outputs a blank file.
Code:
main.cpp:
#include "decompress.h"
int main(int argc, const char * argv[]) {
if(argc == 3) {
decompressor(argv[1], argv[2]);
[code].....
View 4 Replies
View Related
Mar 21, 2014
I am trying to draw a 2d grid array for a battleships game. I need the grid to have a border around each cell, how to do this. so far my code is:
#include<iostream>
using namespace std;
int main(){
int grid[5][5] = {{0}};
[Code] .....
View 4 Replies
View Related
Aug 4, 2013
My goal is to create a loop that keeps taking user input over and over until the user doesn't enter anything into 'cin >>', leaves the line blank, and simply presses the ENTER key to move on, at which point the program is supposed to break out of the loop and continue on with the rest of program execution. Something like this:
Code:
do {
cout << "
Enter a name: ";
cin >> input1;
if (input1.empty())
[Code] ....
As you can see, I've already tried using the empty() function, but that didn't work, the program simply stays in the loop and doesn't break out, no matter how many times I press enter. It just keeps prompting me to enter a name. I've also tried using something like
Code: if (input1 == "")
but that doesnt work either. How do I break out of this loop?
View 2 Replies
View Related
Feb 17, 2013
//#include "stdafx.h"
#include<iostream>
#include<cmath>
using namespace std;
//class declaration
class dayType{
public: int presday;
[Code] ....
So everything works perfectly, well not everything lol. Code compiles successfully without any errors but previous day does not calculate. In a sense that when it asks for number of previous days it returns a blank statement.
For example: Previous number day is: shows nothing
View 2 Replies
View Related
Aug 4, 2013
So I've run into the following problem. My goal is to create a loop that keeps taking user input over and over until the user doesn't enter anything into 'cin >>', leaves the line blank, and simply presses the ENTER key to move on, at which point the program is supposed to break out of the loop and continue on with the rest of program execution. Something like this:
do {
cout << "
Enter a name: ";
cin >> input1;
if (input1.empty()) {
[Code] .....
As you can see, I've already tried using the empty() function, but that didn't work, the program simply stays in the loop and doesn't break out, no matter how many times I press enter. It just keeps prompting me to enter a name. I've also tried using something like
if (input1 == "")
but that doesn't work either. How do I break out of this loop?
View 1 Replies
View Related
Jan 5, 2015
I have followed the tutorial here - [URL] .....
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...
"NumericControl.xaml"
<UserControl x:Class="[snip].UserControl.View.NumericControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
[Code] ....
View 14 Replies
View Related
Oct 2, 2013
I have already data in two dimensional matrix but some cell is empty.Now i want to put 0 in blank cell.
View 2 Replies
View Related
Feb 19, 2014
Well still working on my project, now the bubble sorting failed. For some reason the first slot in the array is empty and when I attempt to enter a record to access, it just crashes or prints a blank record. Here is my code for the viewing of the record and a SS of the empty array slot.
Code:
void searchRec(void) {
void Printing(int *ver, int *max);
FILE *fPtr;
struct Students vStudnt;
int set;
int ver;
int i = 0;
int fin = 0;
int sel;
char order;
[Code]...
Well I don't see why there is a empty slot, why?
View 6 Replies
View Related
Feb 18, 2013
Modify your code by adding your own tests to see if your functions work right. Include at least 6 separate tests, of your choosing.
For example, test the compare function with the first parameter as a blank string -- then with the 2nd as a blank -- then both. Test compare with the first string shorter than the second -- then the other way around. Test your copy function with long strings.
I am struggling with how to use the compare function with a parameter as a blank string. I tried leaving the first parameter blank but doing ("",text) but I don't think that is the correct way of doing this.
#include <cstring>
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
int myStrLen(const char[]); // return length of null-terminated string stored in char array
[Code] ....
View 2 Replies
View Related
Feb 7, 2015
My program does compile and counts the number of lines of code, which is LOC: 20. My issue this, according to my code instruction it should not count comments (//) and also shouldn't count blank lines of code. Unfortunately my code is counting // and white space.
What seems to be working is #, all three includes are not being counted. That’s a good sign. I’m using the same technique not to count #. Why isn't working for comments and blank lines? I’m pretty sure that my logic is correct. I think my problem is maybe syntax.
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main() {
//read my file
[code]....
View 4 Replies
View Related
Feb 14, 2014
I am having trouble returning use input from iterations after the first series of input from the user. My readCourseArray function can only have one parameter and it is information from the structure Student. This information is gathered from a function which is not in the code below because it works fine. I have hard coded a few lines to try to figure out why I am not getting any input after the first pass of the readCourseArray function. I have tried to delete the tempArray in the function after each pass assuming that that could be the issue. But it was not. At least from what I have gathered. I have tried ignoring new line characters which I never really though was an issue but I tried anyways.
I guess what I am asking is: Is my problem coming from the function itself or from my assignment of the cArray to the return tempArray values?
Like I said, the first pass will print out all of the user input (if I put the code in) but all others will return bad values. I did have a do/while to print out the values but it caused the program to crash. I assume because it hit a bad value and needed to break.
#include <iostream>
#include <string>
using namespace std;
struct Student {
string firstName, lastName, aNumber;
int numberCourses;
double GPA;
[Code] .....
View 2 Replies
View Related
Jul 10, 2013
I have faced a strange problem in File Save Routine. I have written a module to save data to binary file . I have designed a structure and put information in that and save it to file . I save multiple such records one after other. I use fwrite , fflush instructions.
The module is working fine. I have saved near about 35 such files. But in one file , the module has saved Blank Records. The file size if perfect but the file is totally blank. It has happened for only one file but need to know the reason.
View 14 Replies
View Related
Mar 5, 2013
I have to make a 8-puzzle and I got the algorithm i just dont know how to restart the program every time i type the move of the blank place in the 3x3 puzzle so i dont have to make 10000 lines to solve the puzzle
View 2 Replies
View Related
Feb 7, 2015
I'm making some progress. My program does compile and output the number of line per code, but it shouldn't count comments and blank lines. I tried using (s.substr(0,2) == "//") as suggested but it didn't work.
This is my improved code:
Code:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
const int A = 3;
int main() {
string s;
[code].....
View 1 Replies
View Related
May 9, 2013
I tested my count funtion. So my count function is not working properly, it should return 5 because 5 words have prefix "tal," but it is giving me 10. It's counting blank nodes.
This is my main.cpp file
int main() {
string word;
cout<<"Enter a word"<<endl;
cin >> word;
string filename;
[Code] .....
View 9 Replies
View Related
Aug 27, 2014
Yes, exactly, and I have been successfully creating EF Model before from the same database.... Why is it acting up now... I did check SO and they seems not to have a solution for it also....
View 8 Replies
View Related
Jan 28, 2015
Code:
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include<string.h>
int main(void) {
int i;
char *str;
int len = 1;
[Code]...
View 3 Replies
View Related
Mar 14, 2013
Is it possible to write a program such that it will automatically execute the function in queue base on their priority even if user programmed it randomly?
Code:
function1(){ very_important; }
function2(){ important; }
function3(){ less_important; }
int main() { // Programmed by user
function3;
function1;
function2;
//Output: Program will execute function1, 2 and lastly 3.
}
View 2 Replies
View Related
Aug 13, 2014
I compiled/built a code I had and made an executed file but when i click on it the CMD closes instantly. Is there anyway to keep this open?
View 10 Replies
View Related