C :: Program Which Recovers JPEGs From Raw File Of Memory Card

Mar 28, 2013

I am working on a c program which recovers jpeg files from .raw file of a memory card. My code is here-

Code:

#include<stdio.h>
#include<stdlib.h>
int main(void) {
File* inptr=fopen("card.raw","r")
if(inptr==NULL)

[Code]...

But while compiling it I get this error-

Makefile:2: *** missing separator. Stop.

View 2 Replies


ADVERTISEMENT

C :: Read Text File From Memory Card Using Threading

Mar 25, 2013

I need do read a text file from memory card using threading.

I am able to do it with out using thread but because of some limitations, i have to do it with threading only.

Here is the code to read file from memory card with out thread:

Code: ##########################################
#include <stdio.h>
#include <stdlib.h>
#include <XMC4500.h> /* SFR declarations of the selected device */
#include <DAVE3.h> /* Declarations from DAVE3 Code
#include <stdio.h>
#include <string.h>
#include <stdbool.h>

[Code]...

View 4 Replies View Related

C++ :: Not Able To Write JPEGs To File

Feb 2, 2015

I have written a tar program and now I can take files add them to a tarfile and extact them into another directory. The problem is that it doesn't work with jpegs. I imagine in it has to do with how I am reading and writing because it is a binary file. I have used "rb" "wb+" etc for accessing the files.

My code -

#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <errno.h>
#include <iostream>
#include <string.h>
#include <utime.h>
using namespace std;
struct stat sb;
typedef struct{

[Code] .......

View 3 Replies View Related

C :: War Card Game With Linked Lists And Dynamic Memory

Apr 23, 2013

I am struggling to finish up my game of War. There are a few problems I have ran in to. My shuffle function seems to work fine. I believe my problem lies within my game rules. When I run my code, the game usually plays all the way through but almost always ends in 'War'. I am struggling to get the game to restart after running once. I am not sure how to clear the list and start over.

Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <Windows.h>

[Code] ....

View 4 Replies View Related

C++ :: Program To Generate A Report Card?

Aug 28, 2013

For a school homework i had to make a c++ program to generate a report card so i made this program

#include<iostream.h>
#include<conio.h>
void main()
{

[Code].....

The problem is that it does not take any values ps I have been learning C++ for 3 months so we don't have any arrays,at max we have iterations

View 5 Replies View Related

C :: Retrieving SIM Card Number From Dongle Using Program?

Jan 2, 2014

I want to get or view the SIM card number from the dongle (the dongle will b already connected to the computer where the SIM card will be inserted into it) but the coding should be done by C programming / Language.

View 5 Replies View Related

C++ :: Program That Simulate Card Game - Array Manipulation

Apr 26, 2013

Consider a program that simulates a card game, with multiple player hands and a deck to draw from. Each hand can use an array to represent the cards it contains; sometimes it is useful to also declare an additional variable for each hand (or deck) indicating exactly how many cards are present.

1) Describe a simple function that would manipulate both the array representing a hand and the number indicating the size of the hand.

2) Describe a simple function that might be able to manipulate the array without referring to the hand size variable at all.

3) Generally, if the array was passed as a parameter to a function, how often would the hand size be included as a parameter?

View 2 Replies View Related

C :: Append Data To Array Of Structures In Memory Then Put In File When Program Ends

Dec 4, 2013

I have a program that stores health information the user inputs, one person at a time. The program works perfectly with the exception of storing the data...I need to open a file and read what health data it has in it already, if any, but store the new changes, and appended data to the array of structures, to the data in memory. All of the information is only saved back in the file once the program terminates. I'm not sure how to go about doing this, so I am also not sure what to put in the function for "Save and Exit" that the user can choose in order to exit the program.

Code:

#include "stdio.h"
#include "stdlib.h"
#include "string.h"
struct strdatabase
{
char first[20];
char last[20];
char gender[2];

[Code]...

I tried playing around with this bit of code, but I'm not sure if I'm even on the right track.

Code:

FILE *fp;
fp = fopen ("students.txt","rb"); fseek(fp, 0, SEEK_END);
long pos = ftell(fp);
fseek(fp, 0, SEEK_SET);
char *bytes = malloc(pos);
fread(bytes, pos, 1, fp);
fclose(fp);

View 9 Replies View Related

C++ :: JPEGs Recovery From Forensic Image - Optimizing Code

Jan 21, 2013

I'm taking a CS course and we've been tasked with creating a program that recovers jpegs from a formatted CF card which uses the FAT file system with a block size of 512 bytes, the jpegs in the card are block aligned which means that the beginning of a jpeg marks the end of the former.

I've wrote the program and it works nicely and recovers the 51 jpegs in the CF card (actually just an image of some 4-5 megabytes of the actual card which can be downloaded here) but I'm looking for ways to optimize/improve my code so I need a second look from experienced programmers.

Here's my code:

Code:
/*
* filename : recover.c
* description : Recovers jpegs from a forensic image
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#define BLOCK 512 // fat file system block size
int main(void) {
// open CF card image

[Code] .....

My questions are:
1) What are the possible optimizations that can make my code faster/better/more concise?
2) I'm not handling slack space, since trailing zeros at the end of a jpeg won't affect rendering it (we were told it won't contain any garbage values)... how may I approach the problem?
3) Can I enhance my if else constructs? or even replace them with something more elegant?

View 14 Replies View Related

C Sharp :: Finding String From Physical Memory Dump File (RAW File)?

Feb 5, 2014

I need to find a string(&login=) from physical memory dump file.And i have to print the word or string following it.Is there any C# code for this problem?

View 3 Replies View Related

C :: Program That Saves Information On Memory

Jun 25, 2014

I am doing a program that saves information on the memory and then i need to put by ascending order the student number.. but i can't get it to work...i tried with strcmp but not worked...

Code:
typedef struct {
char name[100], email[100], adress[100], postal[100], number[20];
int phone
}data; t

Then i have this to input data

Code:
void add(data* contact) {
if (i<total) {
printf("
Name: ", i + 1);
fflush(stdin);

[Code] ....

View 13 Replies View Related

C :: How To Initialize Deck Of Card

Mar 25, 2014

The deck of cards so it is populated with all 52 cards. Once you have populated the deck, you need to shuffle the deck. Here is a simple algorithm you might consider for this purpose:

For each card up to the middle of the deck generate a random number modulus the size of the deck, swap the current card with the card at that location done

To implement this requirement you need to implement and use the following functions:

void initDeck(Card * deck);

View 4 Replies View Related

C++ :: Display Of Card 2D Array

Sep 9, 2013

i was reading trying to get it how to display the out put, all i got to is how to declare the arrays. How to start it also i saw some examples have " struct card"

the display should look like this:

2c 2h 2s 2d
3c 3h 3s 3d
4c 4h 4s 4d
5c 5h 5s 5d
6c 6h 6s 6d
7c 7h 7s 7d
8c 8h 8s 8d
9c 9h 9s 9d
10c 10h 10s 10d
Jc Jh Js Jd
Qc Qh Qs Qd
Kc Kh Ks Kd
Ac Ah As Ad

#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int deck [13][4];
string suits [4] = {"h", "d","c","s"};
string values [13] = { "2", "3", "4", "5","6", "7"," 8" ,"9", "10"," J", "Q"," K" , "A"};
system ("pause");
return (0);
}

View 2 Replies View Related

C# :: Cricket Score Card?

Mar 24, 2010

I have to develop an application named smart client score board in c#

Main requirements for this application are that application should display the live scores, detailed score board, running commentary (in text), players and team profiles, statistics of matches, results and fixtures for cricket.

sort out websites which support rss feeds for full score card.

View 6 Replies View Related

C++ :: How To Store Variable In Memory When Program Is Closed

Nov 3, 2013

How do you store a variable in memory so that it isn't changed when the program closes? I don't have any experience with this and am just wondering how it is possible. I am creating a program and want it to store your preferences and scores. In a simple program, everything is just reset and I don't want this for my program. How do I store a variable so that it stays the same, but can be changed even when the program is turned off?

View 2 Replies View Related

C++ :: Read Variables And Methods Of Another Program In Memory?

Jan 16, 2013

i want to write a program that can access to variables and methods of another program. I ques for access to variables need to read memory, but about methods?how i can use methods and call them?

View 1 Replies View Related

C++ :: Free Up Memory In Client Server Program

Nov 22, 2013

How to free the memory and address,value

Server:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>

[Code] .....

Client:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>

[Code] .....

View 1 Replies View Related

C++ :: Plant Tree Program Memory Leak

Mar 2, 2012

Write a C++ program that had a base class PLANT with a sub class of that of TREE. The Program works exactly to her specifications except there is a memory leak.

--Header Files --
Plant.h
Tree.h
--Resource Files--
plant.txt - For Input
tree.txt - For Input
plantReport.txt - Output of Program. No cout is really allowed by her.
--Source Files--
Plant.cpp - Code for plant.h class
Tree.cpp - Code for tree.h class
MainDriver.cpp - Contains int main()

View 14 Replies View Related

C++ :: Program That Can Detect Special Type Of Memory Leaks

Sep 18, 2014

I'm searching a program that can detect a special type of memory leaks, like these:

int a = 12;
char c[10];
char cc = c[a];

View 8 Replies View Related

C/C++ :: Intuitive Data Structure To Use For Memory Management Program

Mar 21, 2014

I have an assignment that wants me to better understand how certain calls like malloc() and free() work. I'm supposed to have one function that allocates a pool of memory for the program to use (this is the only place where I'm allowed to use the malloc function. Anyplace else is off limits, except when allocating space for data structures.) Another function needs to be defined that allocates memory from this large pool of memory that we have already allocated. A third function needs to free a block of memory when a call from function main is made and a fourth does something else (haven't gotten that far yet.) I'm not sure if it's ok or not, but I'll attach the pdf form that describes all the requirements. If that's not ok, I'll delete it.)

Anyways, when thinking of data structures to use for this particular problem, one doesn't jump out at me as being THE data structure that would be most useful. How I would imagine using it is to store the addresses currently being used as well as the block length of those addresses (so basically, each node of the linkedlist would have a pointer that points to an allocated address and another field that told the size of the allocated block of memory.) How to communicate to the large pool of memory that a certain block of memory has been allocated and shouldn't be used until a free is made on that specific block of memory.

Attached File(s)
pa3.pdf (61.07K)

View 2 Replies View Related

C :: Card Shuffling - How Numbers Are Not Repeated In Function

Jan 27, 2014

I found a card shuffling function on a long dead thread.

Code:
for (int x = 52; x > 0 ; x--)
{ y = rand() % x;
temp = deck[x];
deck[x] = deck[y];
deck[y] = temp; }

I do not understand how numbers are not repeated in the function. It seems like it would be possible to get 2 cards with the same number with the above function.

I also am getting incorrect numbers. It seems like I should only get numbers between 1 and 52 (which is what I want). However, I am getting the number 0, and some number between 1 and 52 will be missing, but I will have a total of 52 unique numbers.

I played around with using 51 instead of 52, x > 1, and changed to --x and none of those produced the desired results.

View 5 Replies View Related

C++ :: Credit Card Validation - Type Selection

Nov 17, 2014

We have to ask the user to select either a Visa card type or Mastercard type. Then, we must ask the user to enter the 16 digit card number and determine if the card is valid or not using module 10. If the answer is zero then it is a valid Visa card and if the answer is zero the answer is a valid MasterCard. My problem is that the I have not separated the validation for MasterCard separate from visa.

Here is what I have so far:

#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main() {

string type, num;

[Code] ...

View 5 Replies View Related

C++ :: Function To Randomly Determines Suit And Value Of A Card

Jul 19, 2013

I'm writing a card game and I'm having trouble getting the first part of it right, which is picking out a random card from the deck and displaying it to screen. So it's supposed to display a different card every time i run the function in the program. The problem is, I keep getting the same output every time "Nine of Hearts".

This is what I have so far,

#include <iostream>
using namespace std;
//declare two string arrays
//one holds the "suit" of the cards, the other hold the "value"
string suit[] = {"Diamonds", "Hearts", "Spades", "Clubs"};
string faceValue[] = {"Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ace", "King", "Queen", "Jack"};

[Code] ......

This is the output I keep getting every time I run the program:

Nine of Hearts

This "random selection" function I'm trying to do is meant to work as a means of shuffling the cards in the beginning of every round in the game and displaying only the top card from the deck.

View 1 Replies View Related

C/C++ :: Sorting A 10 Card Poker Hand Using Qsort?

Nov 8, 2014

I almost finished a program but am stuck on sorting the hand im dealing with qsort. sorting by the face values and if they have the same faces im suppose to follow this suit order to determine which one is greater (Clubs, Diamond, Hearts, and Spades) how would i adjust my comparator function to do this for me ?

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define DECK_SIZE 52
struct card {
const char *face;
const char *suit;

[code]....

View 4 Replies View Related

C/C++ :: Reading Barcode Card Scanners Output?

Jul 18, 2014

How can I get scanned barcodes from the barcode card scanner as a result to use it in c# database.

the platform is xp,7,8 and net framework 4

View 1 Replies View Related

C++ :: Program That Prints Out Memory Addresses Of Each Element In Two Dimensional Array

Jun 21, 2013

the question is; Write a program that prints out the memory addresses of each element in a two-dimensional array. Check to see if the values printed out make sense to you based on the way I explained it before.

Below is the code I have done. I am having problems printing the "-" sign to keep formatting with the board when the user enter in different dimensions other than [4][4].

Code:

#include <iostream>
using namespace std;
void printTable (int x, int y) {
int **p_p_twoDimension = new int* [y];
for (int i = 0; i < y; i++) {
p_p_twoDimension[i] = new int [x];}

[Code]...

View 12 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved