I can't debug anything and get an error whenever I try. Being able to release a program to run it works sometimes, but it's hit or miss. I've created a very simple program to show the problem. The error on the screen is a result of me trying to debug, but I actually received the same error when trying to release as well.
int main() { int x = 1; char *y = (char *) &x; printf("%d ", *y); }
The output will be either "0" or "1" depending on the architecture of the system.When I executed on my system I got output as "1", now what is the architecture of my system is it 32 bit or 64 bit?
I am using the gnu glpk library to calculate a linear program for my matrices. Why I get the error message exit code 3 which apparently means "The system cannot find the path specified"?
I am making an application that runs on Machine1 and the purpose of the application is to copy the files from Machine1 to Machine2. It works fine but i have to share the folder of the Machine2 where i copy the files.
I dont know how to modify the previous record that i have done in the Add Student function. i searched from different sites and got this code for modifying a record in a text file. But, i cant figure it out why its not working.
Which is best option to save images in database or file system, I am developing c++ server client app. I want to save the images in server using file system or database. I am confusing to choose which option?
I want to delete the folder from the file system, but I am getting error of access permission.
I want to change the permission of the folder so my program can delete it.
The problem I am facing on google search is I am getting results mostly for MFC code which is windows specific. However, I want to write a code in core C++ that works on all platforms like unix and windows.
I have been creating this program for a student registration system. For the file handling So far I can write in to a file , view all records, and search a single record. now i got the problem with updating details . my coding is as bellow ..
So I'm doing a kind of banking system. Atm I've got the user able to create an account and set the balance of it, which is written to a .txt file. However, I would like the user to be able to enter their account no. and the program to cout the account info on the screen. I will be adding more to the program later, but until I work out how to search for values in a .txt file, and print out values on that line I'm a bit stuck.
Code: Main.cpp - #include <iostream> #include "create_account.h" #include <fstream> using namespace std; int menuin; int main() { create_account creataccObj;
i can't seem to get my program to save the Set.savv file and encrypt it and decrypt it when user logs back on to there virtual file on a CD and writing it to the disk its self and closing the session
Program background: Ticket Sales Details You will sell tickets in advance and at the door. Prices for buying in advance and at the door will be given. Also, the total number of tickets sold in advance will be given. Each guest will have a unique number. If there are n tickets sold in advance, then these guests will be numbered 0 through n-1. As the event starts, requests to buy tickets at the door may be made and these guests will be numbered sequentially, starting at the lowest unassigned number. The maximum number of guests will be 1000. The first line of the file contains the following three values, separated by spaces: Cost of the presales tickets (in dollars), Cost of the tickets at the door (in dollars), and the number of presale tickets. The first two values will be positive real numbers to two decimal places and the last will be a positive integer.
The second line of the file will contain one positive integer representing the number of auction items followed by a positive real value to two decimal places (at most) representing the minimum bid increment, in dollars. The first value is guaranteed to be 1000 or less and the second will be in between 1 and 50, inclusive.
The third line of the file will contain all the prices of the auction items, in dollars, separated by spaces, in order. Thus, the first price is the price of item 0, the next price is the price of item 1, and so on. These values will be real numbers represented to up to 2 decimal places.
The fourth line of the file will contain the three following positive integers pertaining to the raffle: the number of raffle tickets available, the cost of a raffle ticket in dollars, and the number of raffle prizes. (It's strange to have raffle tickets that don't cost a whole number of dollars.)
The fifth line of the file will contain each of the values of the raffle items, in dollars, separated by spaces, in order. Thus, the first price is the price if item 0, the next price is the price of item 1, and so on. These values will be real numbers with upto 2 decimal places.
The sixth line of the file will contain ten positive integers representing the number of each of the drinks 0 through 9, in order, that are in stock.
The seventh line of the file will contain ten positive real numbers with upto 2 decimal places representing the price of each of the drinks 0 through 9, in order.
The eighth line of the file will contain a single positive integer, numEvents, representing the number of events that occur at the charity ball. These events are split into two groups: actions by guests at the ball and awards given (raffle, auction, person, totalrevenue). All of the actions precede all of the awards. You will produce exactly one line of output for each event described. Here are the formats of each event that could occur:
If a patron buys a ticket at the door, a command will be on a line by itself:
BUY TICKET k
where k is a positive integer indicating the number of tickets bought at the door. These guests will be numbered as previously mentioned. You are guaranteed that the total number of tickets bought, including presales, will not exceed 1000. This is what I have so far and I cannot figure out why it wont calculate the total revenue. I am not completely sure if it is even accessing the if statement in main.
Code:
#include <stdio.h> #include <stdlib.h> #include <string.h> #define N 1000
I wrote the below code to find the line with "abc" as my parameter to strTosearch. I expected to the line 1st line but, this function always match the 2nd line. What am I missing here?
I wanted "found" to be "abc def hgi SSS".
Code in main() String found=GetstringColSamLine("mytext.txt", "abc");
I just got assigned a project in my C programming class. The objective is to find the min and max number out of a .txt file full of numbers on separate lines called "data.txt". I am pretty much stuck at this point. I don't know how to actually scan the file and print the min and max. Also, the list of numbers in the data.txt file contains hundred on hundreds of numbers. So I couldn't specify the exact amount of numbers listed in the file. I must also find the count number, sum, and the average of the given data, So far I have:
Code:
#include<stdio.h> int main() { int counter=0; int maximum=0, minimum=1; int num_data_points, avg; double max, min; FILE *sensor; sensor = fopen("data.txt", "r");
when I try to run the program (new to VC++, I click the green arrow next to "Debug" in the toolbar, right) and I get a message box - code builds without errors - but the debugger says: "Unable to start program 'c:users/sal/documents/visual studio 2010/Projects/SFML App/Debug/SFML App.exe Cannot find file specified"...well, I go to the directory it says, and nothing is even in the Debug file.
I'm trying to write a program for a pong game using a tutorial online. Every time i try to run my program its telling me "Cannot find or open pdb file" I have tried running Microsoft visual c++ as administrator and checking the box next to the Microsoft symbol server. I only get a black console screen with a blinking cursor.
I am working with windows mobile 6.5 and sql compact, trying to create application to save pic on database but when i try to save pic that loaded to picturebox it giving this error "could not find file 'picturebox" and in windows mobile we don't have imagelocation property and this is code that i use it
using System; using System.Linq; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing;
'test.exe': Loaded 'C:UsersPcDocumentsVisual Studio 2010Projects estDebug est.exe', Symbols loaded. 'test.exe': Loaded 'C:WindowsSysWOW64 tdll.dll', Symbols loaded (source information stripped). 'test.exe': Loaded 'C:WindowsSysWOW64kernel32.dll', Symbols loaded (source information stripped).
[Code]...
The thread 'Win32 Thread' (0x2d0) has exited with code 1 (0x1).
The program '[6040] test.exe: Native' has exited with code 1 (0x1). my code is not wrong but there is an error which ı dont understand ...where is my error?
I have write a program to read ppm file and write a new ppm file. However, I'm not sure how to find the darkest point in this ppm file.
Note: 1. there are 610200 RGB point, but my new file only created 176196 RGB point. 2. RGB range: 0-255. (0,0,0)= black; (255,255,255)= white 3. When reporting the location of your dark pixels, assume the upper left corner of the image is location 1, 1
I'm working on a silent auction program that will scan a file and find the highest from each group of bids, then have a running total of money made throughout the auction. I'm pretty sure the rest of my code works, i'm just getting stuck on finding the largest number from the line in the file, saving it, then moving to the next auction.
input file text (first number is num of auctions, after that it's num of bids, then the bids):
Sample Output Auction 1 sold for $500.00! Auction 2 sold for $700.00! Auction 3 sold for $300.00! Auction 4 sold for $920.00! Auction 5 sold for $50.00!
The silent auction raised $2470.00 for charity!
Code: # include <stdio.h> # include <stdlib.h> # include <time.h>
The first loop will print out all of numbers in the velocity column. The second while loop is looking for the maximum value in that column. It is supposed to print out the max velocity in the end of the second loop. However, when I build and run the program, it's crashed. I run debugger and received "Segmentation fault" error. When I eliminate the second loop, it run just fine I use Code::Block for text editor.
I have a program that gives the user the option to create an employee ID, name, address and so on. It also has the option to search employee by employee ID.
What I want to know is how to add and replace employee info. For example employee changes address. Also how to delete employee information from text file.
Here's my code:
//This program uses file input and output for an employee information system. #include <iostream> #include <string> #include <fstream> using namespace std; int main(){ ifstream inFile; //declare ifstream as inFile and ofstream as outFile ofstream outFile;