C++ :: Reduction Of The Flash Footprint
Nov 26, 2014
I'm currently involved in an embedded (cortex M3) C++ project where we're about to run out of flash.
A quick check of the map file give that, in our case, the destructors consume about 10-15% of the available space. Since we're allocating all things that are needed at startup but never delete anything (both a requirement & also impossible due to the lack of a proper memory manager) the thought of getting rid of all destructors in the target build is appealing.
I know that this question is somewhat crazy/desperate but is there a safe way of telling gcc not to emit any code for destructors? If so, can that be made in such a way that a linker error catch for instance mistakes such as creating an object on stack?
View 12 Replies
Feb 22, 2014
How to accumulate the reduction in health points in the loop. I have structured my program so it calls to 2 functions during the loop. These are the playerStrike() and computerStrike(). They seem to be looping well with the one exception that the counters reset back to 100 health points each time. I know it's reloading the original variable amount but how to prevent it from doing this.
#include <iostream>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <cstdlib>
using namespace std;
//function prototypes
void playerStrike();
void computerStrike();
[Code] ...
View 3 Replies
View Related
Apr 13, 2014
I'm writing a program that calculate the carbon footprint for car, building, and bicycle. i have three classes building, car, bicycle. class called carbonfootprint have the pure virtual and should have the formula, but i didn't find it. having a little bit hard understanding some requests. like,
• Write an abstract class CarbonFootprint with only a pure virtual getCarbonFootprint method. Have each of your classes inherit from that abstract class and implement the getCarbonFootprint method to calculate an appropriate carbon footprint for that class.
• The main() function in the given program creates objects of each of the three classes, places pointers to those objects in a vector of CarbonFootprint pointers. You need to iterate through the vector, polymorphically invoking each object’s getCarbonFootprint method.
// Test program for CarbonFootprint and implementing classes.
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector< CarbonFootprint* > list;
// add elements to list
[Code] ....
View 4 Replies
View Related
Jan 23, 2013
I have to simulate flash memory using C++ for a project.
View 2 Replies
View Related
Dec 9, 2014
I have written some code to make two partitions in USB flash drive. When I ran it I am not able to make partitions on usb. What'll be the problem in this code.
Code:
/-------------------INITIALIZE AND PARTITION-------------------------------//
#include "stdafx.h"
#include <Windows.h>
#include <stdio.h>
[Code].....
View 3 Replies
View Related
Apr 22, 2015
I am trying to write a to a specific sector in a flash drive. The problem is that it will only allow me to write to sectors 0 to 15. When I try sector 16 or higher nothing happens, but in sector 0 to 15 is is working fine.
#define BUFFER_SIZE 512
int main(void) {
FILE *volume;
int k = 0;
long long sector = 0;
char buf[BUFFER_SIZE] = {0};
[Code] .....
View 14 Replies
View Related
Mar 26, 2013
I want to read a file from my flash drive called text.csv. However, I cannot even open the port where my flash drive is connected. This is the code that I am using, but I get error since the first part. When I run the program it says "fopen Error". I am using Ubuntu 12.04.
#include<stdio.h>
#include<string.h>
#define SIZE 1
#define NUMELEM 5
int main(void) {
FILE* fd = NULL;
[Code] ....
View 1 Replies
View Related
Nov 5, 2012
I have a flash movie that is bigger than the axShockwaveFlash placeholder that plays it. The axShockwaveFlash placeholder expands to the size of the movie.
I have found a website at [URL] but asp is totaly different from c#.
How can I make the movie shrink to fit in the axShockwaveFlash placeholder?
View 2 Replies
View Related
Sep 19, 2013
My specific request is for retrieving values that are stored to a CompactFlash card. I am able to store values (we call them recipes) to the CompactFlash card as .csv file. I just haven't been able to figure out the code to retrieve this information back to the touchscreen.
Code:
// Create a new folder if it doesn't exist
CreateDirectory("/recipes");
//Create the file if it doesn't exist
CreateFile("/recipes/recipe.csv");
//open the file
hfile = OpenFile("/recipes/recipe.csv", 2);
[Code]....
Now with that said, I would like to retrieve these values from the .csv file.
View 7 Replies
View Related
Dec 26, 2013
I'm making a flash card type console application using visual studios 2013. The flash cards contain character that I can display using unicode. So far I am looking at about 200 characters across 2 unicode blocks which I don't want to hard code into my arrays. I thought of initializing my arrays using a loop. The only problem is I don't know how to add in hexadecimal. So is there a way to initialize my array without having to input 200 values my self? Also is hexadecimal addition possible without me having to write a function for it?
View 3 Replies
View Related
Dec 11, 2012
I am creating small application using c#.net.I removed all image tag using regular expression no I want to remove all video file and flash file also in source code of webpage.
so far I have tried this ...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
[Code] .....
View 1 Replies
View Related