Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I suppose it would be possible, but the compiler would probably be too huge to fit in memory. That's why compilers stick to just a single language. If you want more than one language, then write a compiler for each language, then write a wrapper program to call the appropriate compiler for the desired language. Microsoft Visual Studio is such a wrapper program and contains compilers for C, C++, C#, VB.NET and several other languages.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

windows os doesn't have anything called a "plugin". They are just application programs. Or do you mean a browser plugin?

Yes, you can write your own compiler, but plan to spend several years doing it. Go to amazon.com and search for compiler books,

Here is an online c++ compiler

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I have an Officejet 6500 on a home network that has Windows 7 Ultimate 64-bit, Windows 8, and a couple other Windows/Linux computers. I had no problems installing the device driver about a month ago. But I installed the HP Solution Center from here, not just the printer device driver.

Did you try to uninstall the existing priter device driver before installing a new one?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

use std::precison and std::fixed modifiers with cout.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I've been online here about 1/2 hour and have not noticed any problems.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Are you saying those two functions are members of a c++ class? If yes, then you need to add class decoration to them, for example if the class name is MyClass then line 1 of the code you posted would be

bool MyClass::determineFirst()

and line 20

bool MyClass::askYesNoQuestion(const std::string& question)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Are you required to provide parameters to those functions? If not, then just declare the variables inside the functions and have no parameters.

#include <iostream>
using namespace std;

// Prototyping the functions
int addition();
int subtract();
int division();
int multiply();

// Main
int main()
{
    // Input, choice
    cout << "What do you want to calculate?\n" << endl;
    cout << "Addition       (1)" << endl;
    cout << "Subtraction    (2)" << endl;
    cout << "Division       (3)" << endl;
    cout << "Multiplication (4)" << endl;

    int choice;
    cin  >> choice;

        // If choice is...
        if (choice == 1)
        {
        addition();
        }
        else if (choice == 2)
        {
        subtract();
        }
        else if (choice == 3)
        {
        division();
        }
        else if (choice == 4)
        {
        multiply();
        }
    }

int addition()
{
    int n1,n2;
    cout << "Please enter the first number: " << endl;
    cin  >> n1;
    cout << "Now enter the second number: "   << endl;
    cin  >> n2;

    cout << n1 << " + " << n2 << " is equal to " << n1 + n2;
    return 0;
}

// (I'm gonna add the missing functions here, don't worry! :P)
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you have to declare the variables somewhere. Function prototypes do not declare variables, they merly tell the compiler what types of variables are to be in the function parmerter. The actual variable names can be anything you want. You can name them "Joe" and "Moe" if you want.

int main()
{
   int Joe = 0;
   int Moe = 0;
   ...
   ...
    addition(Joe,Moe);
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

it took the space " " that exists in the last row

Huh? The function does nothing if there is no '\n' in the string. If you want a space there then modify the function to append a space if there is no '\n'.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

For cross-platform programs I don't know of anything newer or better. If you just want to start a new MS-Windows GUI program then C#, VB.NET or CLR/C++ Windows Forms are probably better.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

When calling a function you do not specify the data type of the parameters, just the names of the variables.

Line 26 should be: addition(n1,n2);

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

From what little I've read about mp4 compression it looks like all it does is convert the mp4 to a different format and quality suffers a great deal. I want something to compress the files with no loss in video quality, but apparently that is not possible.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

How does index.php have anything to do with your c++ program?

One other point about comparing strings -- the std::string == operator is case-sensitive, that is "ok" is not the same as "Ok" or "OK". So if response contains "Ok" then the comparison will fail. You need to make sure both have the same case by converting all the characters in response to lower case before doing the comparison.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Does the input text file have a cr after the last line? If not, put one there and retest. If not then the proglem has to be choppy() -- the last line may not have '\n' at the end of the line.

void choppy( char *s )
{
   char *ptr = strrchr(s,'\n');
   if( ptr != NULL)
       *ptr = ' ';
}

[edit]I removed the last CR from my file and got lots of junk in r.txt file, for the reason I mentioned previously. The new version of choppy() fixed the problem.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Now run this:

        while(fgets(string, sizeof(string), p) != NULL )
            {
printf("%s", string);
              choppy(string);
printf("%s\n", string);
              cop(string, a2);
printf("%s\n", string);
              strcat(a2, nameyes);
              cop(string, a3);
printf("%s\n\n", string);
              strcat(a3, nameno);
              func(string, namesearch, nameend, a2, a3);
            }
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I have over 400 movies and tv episodes, and that collection isn't considered very large. A dvd movie is about 1.4 Gig while a blu-ray movie is abut 7.5 gig. Both are ripped as *.mp4 format. I started out by first creating iso files and then ripping the iso file because with DVDFab it produced better sound-video sync but still not perfect. I almost filled up that 3 TB drive doing that so I had to delete all the iso files.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I'm stumped -- I don't get that . with your program.

Put some print statements in your program so that you can see the contents of variables. Maybe that will narrow down the location of the problem. something like this:

void func(char string[1000], char namesearch[50], char nameend[50], char a2[1000], char a3[1000])
{

            FILE* pr = fopen("r.txt", "a");
            printf("a2 = \"%s\", a3 = \"%s\"\n", a2, a3);
            if(strstr (string, namesearch) || (strstr (string, nameend)))
            {
                fprintf(pr, "%s \n", a2);
            }
            else
            {
                fprintf(pr, "%s \n", a3);
            }

            fclose(pr);



}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

On 32-bit systems today, you can specify a 64-bit integer as a 'long long int'

Not necessarily. Microsoft Visual C++ long long is the same size as a long which is the same size an an int. It does not recognize long long as a 64-bit int. Instead it used __int64.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Neither of the two compilers I used have that character there. Please repost the entire program you used.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What extraneous characters are in that file -- I don't see any problem with it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

post the file you are talking about -- attach it to you post so that the daniweb interpretor won't change it. Here is r.txt that it created for me.

Also, what is the answer to the last question, I answered with a space.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I just finished installing Code::Blocks with MinGW compiler, and it did not have that problem either.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Do you use Notepad to view the file? Dev-C++ is a pretty old and obsolete IDE/compiler. you might want to install Code::Blocks with MinGW compiler from here, it's free and current.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That's not a question, just a statement of what you want to do. No one but you knows why you posted that code. If you want help then you have to tell us what you want help with.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what compiler and operating system are you using?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The problem is on line 20: I replaced the space with '\0'. Put it back to a space.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

strstr() doesn't look for words -- it just determins if the charactes in one strng are in another string. It doesn't care if there are other characters surrounding the string it is looking for. If you want just the word "bread" then you should add a space both before and after it, such as " bread " But that might present other problems, for example if the breat is at the end of the line and there is no space after it, or bread is immediately followed by a period (end of sentence).

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

the program will not differentiate words. example: Bread! = breadblabla.

The changes I made have nothing to do with that. The problem is use of strstr() on line 28.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Did you prototype the functin askYesNoQuestion() at the beginning of your program so that the compiler knows about it?

line 20: It would be better to just set another variable to be toupper(ans) so that toupper() isn't called every time it is used.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

the values for INT_MIN and INT_MAX are shown in the appendices as being the same as SHRT_MIN and SHRT_MAX

It is compiler dependent. That was true 30 years ago when 16-bit MS-DOS compilers such as Turbo C were the standard at the time, but modern compilers are normally 32-bit or 64-bit and the ranges of variables are not the same. The C and C++ standards do not specify the ranges, only that char is 1 byte. The size of all others depend on the compiler, and how they implement the variables is usually dependent on the platform. That is all why you have to check limits.h to find the range for your compiler.

line 14: Why are you using EOF? That is the error code when End-Of-File is reached. It applies to file i/o and should not be used for any other reason. My compiler (Visual Studio 2012) defines EOF as -1. Yours apparently defines it differently.

it would stop within its range. Why is this not occuring?

It's called Integer Overflow -- and when that happens the behavior is undefined. On the compilers I used when the max value is reached the next increment will wrap back around to 0, but there is no guarentee that all compilers do that.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

3 TB is alot of movies

That's the size of the hard drive, not the amount of movies. I've only used about a third of it. I don't need to compress them, plenty of hard drive space, for now.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

post the file you are using.

This didn't give me any unusual characters at the end of the file. The changes I made are marked // <<<<<<<<<<<<<<<<<<<<<<<<<<<<

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include <string>



void cop(char*s1, char *s2) 
{
    strcpy(s2,s1);   // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
//     int i;
//     for(i=0; s1[i]!='\0'; i++)
//         s2[i]=s1[i];
//     s2[i]='\0';   
}

void choppy( char *s )
{
    s[strcspn ( s, "\n" )] = '\0'; // <<<<<<<<<<<<<<<<<<<<<<<<<<<<
}


void func(char string[1000], char namesearch[50], char nameend[50], char a2[1000], char a3[1000])  
{ 

            FILE* pr = fopen("r.txt", "a++");
            if(strstr (string, namesearch) || strstr (string, nameend)) 
            {
                fprintf(pr, "%s \n", a2); 
            }   
            else
            {
                fprintf(pr, "%s \n", a3); 
            }    
            fclose(pr); 



}


int main()   
{   
    char name[30];     
    printf("File: ");  
    gets(name);
    FILE* p = fopen(name, "r");  
    if(p)   
    {
        char separator[2]; 
        char ol[3] = "\n";    
        char string[1000]; 
        char nameforout[50];
        char nameend[50];
        char namesearch[50];   
        printf("Name for search: ");  
        gets(namesearch);  
        printf("separator: ");
        gets(separator);
        cop(namesearch, nameend);
        cop(namesearch, nameforout);
        strcat(namesearch, separator);
        strcat(nameend, ol);
            char nameyes[50];
            cop(nameforout, nameyes);
            strcat(nameyes,"_yes"); 
            char nameno[50];
            cop(nameforout, nameno);
            strcat(nameno,"_no");
            char a2[2000];  // <<<<<<<<<<<<<<<<<<<<<<<<<<<<
            char a3[2000];  // <<<<<<<<<<<<<<<<<<<<<<<<<<<<


        while(fgets(string, sizeof(string), p) != NULL )
            {              
              choppy(string);
              cop(string, a2); 
              strcat(a2, nameyes); 
              cop(string, a3); 
              strcat(a3, nameno);
              func(string, namesearch, nameend, a2, a3);
            }

        fclose(p); 
    }
    else 
         printf("\nNot open %s", name);
    printf("\nOk!!!");     
    getchar();
    return 0;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Curious: why didn't you use standard C string function strcpy() instead of your chop()?

lines 70 and 71: increase the size of those two because they probably aren't big enough.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Hard to tell without seeing the code you wrote. A couple possibilities: 1. the string was not null terminated, 2. buffer overrun (writing beyond the bounds of the buffer)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what operating system and compiler? For MS-Windows you will use these communications functions.

and then automaticly send it over the serial port.

There is nothing "automatic" about it -- you have to write the code to do that yourself using the communications functions.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you can't move the thread -- just hit "Flag Bad Post" button and ask a moderator to move it for you.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That gives me too much crap that I'm not interested in, and still doesn't lead me to Dani's public profile page.

Dani: Can't you just add a simple member search button that does nothing but take me to the member's public profile? I don't want to see thousands of google links that do nothing.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Have you read this wiki article?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

!but i think it's clear that before asking question here i 've googled it.

No it wasn't clear -- you never mentioned it. Had you actually followed and read the 3d link you would have found this:

The process in the description column of the Windows task manager is taken from the product name in the version resource that is statically compiled into the executable. An executable has no way to set this description as runtime.
You only option is to create a native wrapper executable that creates a version resource with a configurable name.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The first thing you should do when researching any topic is to google for your question, like this. If the answer is there at all it will be in one of the first few links, all you have to do is read them.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Seems to be working ok as far as I can tell. Hover the mouse over a link and I see the correct thumbnail.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

All I want is their public profile page.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

How do I search for specific member name? Putting the name in the Search box doesn't work. I tried "<member name>" and "Daniweb: <member name>". google found the name but not at daniweb.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Did you notice the date on that documet? 1986! And it was written by some european manufacturer. That's like taking Microsoft document and calling it the standard. It might have been the standard in 1986, but I suspect the language has evolved a tad since them.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Scroll near the bottom of this wiki article and you will find some references.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I don't know if they do or not -- DVDFab has lots of options, so one of them might do videl compression. I'm certain Aiseesoft Blue-ray Ripper doesn't do that, that program just rips with no optional features.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

First of all, Ancient Dragon's way is not wrong in anyway, in fact he probably knows 20 times more then me. The only reason I suggested doing it this way, was because I personally don't like using multiple arrays, trying to sync up everything and having multiple names

I agree, multiple arrays is not a good way to implement the program. -- but the OP may not have the experience/knowledge necessary to do it that way.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Did you compress those movies? I think a bluray is like 15 to 26 GBs, it depends on the movie. If you compress it, it's like 1 or 2 GB and still keep that quality.

I tried that -- I used two different compression programs, WinZip and something else (I forget right off hand), neither could do much with the files, something in the order of only about 1% compression. Besides, compressed movies aren't of much value to movie players such as Micrisoft Media Player and DVDFab Media Player.

The movie industry doesn't want to see their movies copied and re-sold.

From the link Reverend posted. I don't blame them for that. People like me have no intention on selling or giving away copies of the movies.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Nice assignment.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What should happen with Syira?

Nuke them out of existence -- in fact, just nuke that entire continent out of existance. But first I need to dig me a deep cave and fill it full of water/food so that I won't be affected by the fallout radiation that will envelope the Earth. Ever see the movie "Planet of the Apes"? It might come true.