Visual C++ :: Relationship Between Two Hex Strings?

Aug 19, 2013

I'm trying to make an application for ELM327 trouble code scanning device for my own educational purpose. Most of my app code is done. however, I am stuck at one point. And I need finding relationship between two hex strings.

I have logged some communication between ECU and a chinese code scanning device for carrying out car's fuel pressure test. However there is one message (that is sent from the user side) that keeps on changing each time which is dependent upon the last message received from the ECU which is also varying every time.

Code:
RECEIVED (07E8) SEND (07E0)
05 67 03 0C 17 6A 00 00 05 27 04 8F 45 37 00 00
05 67 03 0C DB 68 00 00 05 27 04 B0 70 6B 00 00
05 67 03 10 3B 87 00 00 05 27 04 3B BC 10 00 00

[code]....

as it can be seen 3 bytes are always changing with each test, both, in the message received from the ECU, and the one sent back to the ECU from the diagnostic scanner. Trying to figure out relationship between these two strings?

P.S: about 16 million combinations for 3 byte data are possible... there must be some link between them...

View 4 Replies


ADVERTISEMENT

C++ :: Difference Between HAS-A And IS-A Relationship?

Mar 20, 2014

What is the difference between HAS-A and IS-A relationship?

View 7 Replies View Related

C# :: Define Optional One To Many Relationship?

Apr 15, 2015

If I’m trying to define an optional one to many relationship I need to reference the primary key of the table

e.g

modelBuilder.Entity<TCC_ArchivedIntegrationExceptions>()
.HasRequired(t => t.TCC_TransactionHistory)
.WithOptional(t => t.TCC_ArchivedIntegrationExceptions);

Where TCC_ArchivedIntegrationException is the optional key.. but those models are inheriting their key from a base entity

So do I have to create the key explicitly in the model or is there another way around this?

View 1 Replies View Related

C/C++ :: Two Numbers Relationship Program Error

Aug 15, 2014

I write below two numbers relationship program and got below error.

//two numbers relationship
//take standard and console input and output
#include <stdio.h>
#include <conio.h>
//take function main
main()

//define numbers {
int num1; //first number
int num2; //second number

[Code] ....

View 3 Replies View Related

Visual C++ :: Random Linked Strings

Feb 9, 2013

I want to make a funny and simple game in cmd with visual studio and here is my plan, here are the steps that I wanna accomplish:

The program asks the person for

1: 4 girl names
2: 4 boy names
3: What they do? (4 actions)
4: Where they do this? (4 locations)
5: Random linked things

And from here I want to randomly get 1 line of a random girl name + random boy name + random action + random place. and followed by the second, third, and fourth line of random chosen things.

Like this:
Girl 1 - Boy 3 - Action 2 - Location 4;
Girl 3 - Boy 4 - Action 4 - Location 1;
Girl 2 - Boy 1 - Action 3 - Location 3;
Girl 4 - Boy 2 - Action 1 - Location 2;

And it can get funny like: Amber and John are jumping from a bridge. a game where you can play with your friends and have fun.

Here is my code so far:

#include<iostream>
#include<string>
#include<ctime>
#include<cstdlib>
int main (void) {
using std::cin;
using std::cout;
using std::string;

[Code] ....

And from here I don't know what to do!!

View 3 Replies View Related

Visual C++ :: How To Access Argv Strings

Dec 22, 2012

I have:

int _tmain(int argc, char* argv[])
{
printf("drive name: %s
", argv[1]);

It displays only the first character of the first argument on the command line.

Yet the following works as expected:

static char* myArg[2] = {"first arg","second arg"};
printf("drive name: %s
", myArgv[1]);

That displays the entire string "second arg".

So what's wrong with my reference to argv[1]?

View 4 Replies View Related

Visual C++ :: Compare Two Strings To See Difference In Int Form

Apr 2, 2013

I want to compare two string, and want to see differeince in int form. For example,

Code:
string first_string="0002AE1";
string second_string="0002AE2";

How can i calculate difference between two string? It is obvious difference between above two string is 1/-1, but difference would be 1.

View 2 Replies View Related

Visual C++ :: Saving Unicode Strings To Txt Files

Jan 20, 2014

In my project , we need to create an Array of Unicode Strings . The Array will contain 5000 Strings.

I need to write those strings to a text file which can be opened or edited with NotePad.

Normal _tfopen and fwrite are not able to create notepad compatible .txt file .. I mean the file I created is not readable with Notepad though file open mode is "w+t"

How can I save my unicode strings to a text file

View 6 Replies View Related

Visual C++ :: Create A Function Using Rot To Encrypt Strings

Sep 30, 2013

I need to create a function using rot to encrypt certain strings the function begins like this

#include "encrypt.h"
std::string encrypt (std::string text, int rot) {
for (int i
and ends like this
return NULL;
}

dont need to write the string encrypted and dont need to crate a decrypt function.

View 4 Replies View Related

Visual C++ :: How To Do Binary Search On A Vector Of Strings

Sep 25, 2012

I'm trying to do a binary search on a vector of strings and keep getting this error. This is the PhoneEntry header file with the class declaration:

Code:
using namespace std;
#include<string>
#include<iostream>
#include<fstream>
#include<vector>
#include"phoneNumber.h"

[Code] .....

View 5 Replies View Related

Visual C++ :: Finding Items (strings) In Multiple Lists

Mar 12, 2013

Im working on a script compiler and i need to handle different types of data. Actually different categories of items.

Let's say i have two categories: cat's and bird's. They are different and stored in different lists. And let's say there is a simple command: GIVE_FOOD_TO(animal_type, food_type) Animal type here can be either from birds category or cat's category.

And also let's say user gives command: GIVE_FOOD_TO(cat1, fish)
and also for example: GIVE_FOOD_TO(bird1, birdfood)

Variable names could be anything, but im storing each variable name in std::map so later i can figure out with what animal current command is used.

When im parsing the script then i must know if user supplied either cat or bird. If i just would have cat's or bird's category then i would have only 2 lists and not a big problem to loop through either cats list or birds list and find out in what list the "cat1" is or in what particular list the "bird1" is. It would be in one or another.

But i have a lot of categories and looping through all of these lists (or std::maps) is slow and doesn't seem like a good. Just to find out in what list it's stored. I can't rely on variable names, they could be anything.

Big picture atm:

1) I have one BIG box which stores all of the categories

2) When i need to find out to which category the variable (animal_type) point's to i must get it quickly, dunno, std::map in std::map or something?

What i need basically is: I have different lists (each one is just a category for either birds or cats in this example) And when i have variable name, i must find out quickly in what particular category this item is stored. So i can work with it.

View 4 Replies View Related

Visual C++ :: Procedure To Compare 2 Strings With Specific Criteria?

Jul 10, 2013

Procedure to Compare 2 Strings with the following criteria

coding of the following function -

I have absolutely no clue where to start -

Given the following sets of numbers -

1154 1179 2154 2554 2484 2144 4515 1144 1517 4815 1481

Given the Index number of 1154

I want to search the numbers for the Index number of 1154

The search will return a True if I can find 3 or 4 same digits between the Index number and the 8 numbers

The search also have the following criteria -

meaning that -

1154 when compared to 1154 == true
1154 when compared to 1179 == false
1154 when compared to 2154 == true
1154 when compared to 2554 == false
1154 when compared to 2484 == false
1154 when compared to 2144 == false
1154 when compared to 4515 == true
1154 when compared to 1144 == true
1154 when compared to 1517 == true
1154 when compared to 4815 == true
1154 when compared to 1481 == true

the index number can also be of type - 1234, 1123, 1112, 1111

View 14 Replies View Related

Visual C++ :: Program That Take Strings From File And Push It Into Stack

Sep 29, 2013

How to write a programme that take strings from file and push it into the stack with number of each sting string before it and later clean the stack?

View 6 Replies View Related

Visual C++ :: Roman Numeral Converter To Decimal Using Array Of Strings

Jun 27, 2013

This program compiles, but has a bunch of logical errors. I know my problem is somewhere in the while loop that I have, but I can't figure out where. Here are some of the issues I am experiencing:

1. At the beginning of the program it asks you to enter a number, and when you do it does nothing while proceeding to the while loop where I have it asking the same question

Code:
"Please enter a number between 1 and 20 (Enter 0 to stop)
";
cin >> num;
cout << endl;

I want to be able to eliminate that first statement but if I only run this in the loop without the above statement the program will display nothing on the screen and proceeds to stop.

2. This code runs fine, except that if you make a mistake, it will prompt you to enter a valid number, however; it ignores your first response if the number you enter is valid and asks you to enter a valid number anyway. Once you enter it a second time, it will accept it and the program will continue on.

Code:
while(num != SENTINEL) {
cout << "Please enter a number between 1 and 20 (Enter 0 to stop) ";
cin >> num;
cout << endl;

Also if you type in 0 on your first response, it will prompt you that it is not a valid number and ask you to try again, instead of stopping the program like it is supposed to do. On your second response the program will accept your 0 and stop the program correctly.

//Write a program that displays the roman numeral equivalent of any decimal number between 1 and 20 that the user enters. The roman numerals should be stored in an array of strings and the decimal number that the user enters should be used to locate the array element holding the roman numeral equivalent. The program should have a loop that allows the user to continue entering numbers until an end sentinel of 0 is entered.

Input validation: Do not accept scores less than 0 or greater than 20

#include <iostream>
#include <string>
using namespace std;
int main() {
// Declare constants and variables
const int romanNum = 21; // Size of the elements in the array

[Code] ....

View 14 Replies View Related

Visual C++ :: Assignment Is Recursive Call And Placing Strings In Link List Notes?

Oct 30, 2013

You need to write a permute class that will take first and second strings to rearrange letters in first, followed by second. For example, if the first is “CAT” string and second is “MAN” string, then the program would print the strings TACMAN, ATCMAN, CTAMAN, TCAMAN, ACTMAN, and CATMAN. The first and second strings can be any length of string or a null.

The permute class uses a Note class as link list note to link all letters arrangement. The permute class has Note pointers, firstNote and lastNote, to point to the beginning and ending Notes of the link list as private data members. There are three other private data members (total, firstString and secondString) to store the total possible number of arrangements and strings pass into the class.

Write a driver to test the permute class to pass in any two strings of any sizes.

Other than mention in the following, you can add more classes, functions, and private data members to this program.

Note class:The Note class needs to have two private data members and a constructor. The two private data members are data and p pointer. The data’s data type is string and p pointer is Note. The Note class constructor has two parameters, one is string and the other is Note pointer.

Permute class:The Permute class has five private data members (*firstNote, *lastNote, total, firstString and secondString). The firstNote and lastNote pointers are point to Note. The total has integer data type. The firstString and secondString have string data type.

There should have at least three public member functions, Permute, permutation and print. The Permute function is the constructor which takes strings to initialize the private data members. The permutation function does the recursive call to arrange the strings and setup the link list. The print function will print out the private data member information.

Driver file:The driver file should declare a Permute eight elements pointer array. Instantiate eight Permute object with the following eight set of data and assign the object to the pointer array. Use a repetition to call the object’s print function to print out the private data member information. If the total of the permute private data member is less than 100 then print out the permutated letters four in a row, otherwise print out 9 in a row.

first = "", second="",

first = "", second ="CATMAN",

first = "C", second ="ATMAN",

first = "CA", second ="TMAN",

first = "CAT", second ="MAN",

first = "CATM", second ="AN",

first = "CATMA", second ="N",

first 1 = "CATMAN", second ="";

View 3 Replies View Related

C++ :: How To Append Strings To The Front Of Other Strings

Apr 7, 2013

I am programming a translator, and I have it so that it detects words with spaces both in front of and behind them, so I did "string.append(space);" where space equals " ". That added a space to the end, but I still need a space added to the front.

View 1 Replies View Related

C/C++ :: Print More Strings (the Strings May Contain Spaces)?

Feb 12, 2014

I have a problem who must print the sentences who have lenght more than 20 characters. I dont know why, but it prints just the first words. Look what i made.

#include<stdio.h>
#include<conio.h>  
int main()

[Code]....

For instance :

Give the number of sentences : 3

First sentence : I like the website bytes.com
Second sentence : I like more the website bytes.com
Third sentence : bytes.com

After I compile the program it should print the first two sentences.

View 2 Replies View Related

C++ :: Adding Two Or More Strings Together

Nov 16, 2013

I tried to add 2 or more strings together but failed.

eg I would like to add "KK" & "LL" together by adding but it couldn't work.

string string_B = "KK";
string string_C = "LL";

string_A = string_B + string_C;

View 2 Replies View Related

C :: Can Strings Fit In Array

Mar 5, 2013

1. I finished reading a beginning C book, and in the section about arrays, it says that one string can fit in a character array (char arrayname[]) but there cannot be a string array (string arrayname[]) that have multiple strings. Is

Code: string arrayname[4] = {"one", "two", "three"}; not valid?

My compiler lets me run it and it works, but why is the book saying it's wrong?

2. I know you can represent multiple strings in a character array by:

Code: char newarray[10][4] = ("one", "two", "three");

because [10][4] indicates that there should be four newarrays created with a max of 10 characters each, but is

Code: string multiplestrings[10][4] = ("i love you", "hello come to me", "i don't get C"; "hello world", "what are arrays"; "i am happy", "I am learning how to code"); valid?

Does multiplestrings[10][4] basically create 4 string arrays that have a maximum of 10 different strings within each string array?

View 6 Replies View Related

C :: Join Two Strings?

Dec 14, 2014

How join two strings? basic reason is add given filename little text to end. I try do by hobby not school project program which converts files format x to format y.i dont say which formats becouse reading and writing is almost done. (only little amount code is needed).'

View 2 Replies View Related

C++ :: How To Put Strings Into Arrays

Feb 9, 2015

javascript:tx('quote')
void family () {
string father;
string mother;
string kids;
int x;
int y=0;

[Code] .....

How am I allowed to but the 3 strings father, mother and kids in a array?

View 3 Replies View Related

C++ :: How To Use Strings In A Function

Mar 26, 2014

None of my string is coming out onto my output file..

void OutputHeading (ofstream& fout, string CLASS_EXERCISE,
string PROGRAMMERS_NAME);
void OutputDivider (ofstream& fout, int WIDTH,
char symbol);
void OpenFiles (ofstream& fout, ifstream& fin);

[Code] .....

View 1 Replies View Related

C++ :: How To Use If Statements With Strings

Jul 3, 2013

I've got a very simple but annoying problem.

if (letter3=="
"){
letter3==letter;
PrintCharacterLineEnd();

This is a code. the string "letter3" contains the string "
". What I want to happen is when, letter3 contains the text "
" I want to go to the function PrintCharacterLineEnd.

However, as of right now it's not working.

View 14 Replies View Related

C++ :: Add Two Numbers As Strings

May 19, 2013

I need to make a small program with a function with this prototype: void f(char *a,char *b) that adds two numbers represented as strings without using conversion operators or other tricks.

View 17 Replies View Related

C++ :: Why Are All Strings Constant

Apr 10, 2013

why all strings are always constant?

View 2 Replies View Related

C/C++ :: How To Add Strings To Vectors

Apr 19, 2012

I have a vector I want to add book titles to, then i want to print my updated vector. This is best I have come up with but the program fails at the getline line. why?

string book;
cout << "Enter book to add: "<< endl;
getline(cin, book);
books.push_back(book);
for(int i = 0; i < books.size(); ++i) {
cout << i+1 << ". " << books[i] << endl;
}

View 1 Replies View Related







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