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

Welcome to DaniWeb.

>>What would be a good way to learn C++ online for free
First, learn to read and research. This question has been asked thousands of times in the recent past. Start out by readig the Read Me threads at the top of this forum -- you must have just skipped right over them when you posted this thread. There is a lot of information there that wil point you in the right direction. Programming requires a lot of reading -- start out by doing just that.

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

>>First, sorry for my english, i am argentinian
Your English is great -- no need to apologise for anything.

Did you define HAVE_STDINT_H somewhere ?

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

#ifndef HAVE_STDINT_H // if not already defined, then we'll define the symbol here
#define HAVE_STDINT_H
#endif

#include <odbx.h>

int main(void) {
	puts("Hello World!!");
	return EXIT_SUCCESS;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>I speak Spanish
Well, then do you know what "crap" means in English?

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

Welcome crapodino. What is your native language (what language do you speak at home)? What are your intrests and hobbies.

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

create a loop to read each line into a std::string object, then call string's find method to see if that line contains the string you want to find.

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

you can use an iterator

list<int>::iterator it;
for(it = mylist.begin(); it != mylist.end(); it++)
{
    list<int>& sublist = *it;
    // blabla
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Obama on top of that is a fundamentalist Muslim.

.

this doesn't look like a muslem church to me. And here's another reference to Obama's religious beliefs.

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

obama isnt an exremist.

Obama grew up in culturally diverse surroundings. He"was not raised in a religious household." He describes his mother, raised by non-religious parents, as detached from religion

Isn't that exactly how over 50% of Americans are raised ?

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

Obama like Clinton is a leftist extremist. Obama on top of that is a fundamentalist Muslim.

No he isn't.

Vote for him if you want Sharia law in the US, vote for Clinton if you want the US to turn into North Korea.

People said that about John Kennedy too in 1960 (the Pope would be ruling the nation), never happened.

What does someone's religion have to do with his/her qualifications to be President ? Answer: not a damned thing.

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

yes, yes, yes, and yes. Beginning to sound like the Beetles Yea Yea Yea!

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

I have normally voted Republican in the past, but I don't think I will this year. I don't see any republican candidates that would make a strong president. Obama impesses me a lot because he knows how to deliver very powerful and inspiring speaches, much like Reagon did when he was president. Clinton is very cold and calculating -- she might make a good president too but she is not anywhere near as inspiring as Obama.

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

There is no standard way to read it. You first have to determine the file format -- and that depends on what program created it. After you know the format then create a std::ifstream object to open and read it. There are literally millions of ways to read it, so there is no one right answer.

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

autos that apparently don't have working turning signals.

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

what is a "coed" calculator? Anything like coed dorms in college?

iamthwee commented: Amusing! I approve. +13
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

So. Clinton got the winnings in her primary battle ... Anyone see this coming? She puts it to her tears... or near tears, I hear.

Do you get Rush Limbaugh radio broadcast where you live?

Also, what's the difference between caucus' and primaries? Nobody over here seems to know (least not anyone I've asked). The gist is that a caucus is where a party decides on people and primaries are when the people decide who to put forth?

A caucus is sort of like a town meeting that votes together and in public for the candidate of their choice. The all sit in a big room, discuss the issues, then raise their hands to vote. In a primary everyone goes into a private booth to vote. The National Conventions is a large meeting of all the states representatives who will vote for their political party's candidate. Each state is committed to voting for the winner of that state's primary (or caucus) election. If no one person gets a majority of the votes at the Convention then the individual state representatives are free to vote however they wish and the voting continues until a winner is chosen.

See the links in post #11 to this thread for more details (if you really want to get into it that deep)

twomers commented: Thanks for the explanation, and I read the wiki site before asking the question... it confused me a bit. +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It isn't necessary in most cases to actually clear anything other than the first byte of each array. Why? Because they are normally treated as C-style strings which can be used with all the c functions in string.h (or cstring). The one method I posted using {0} when the array is declared actually does clear every byte of the array.

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

There are a few people here at DW who are still in grade school, and several more still in HS. I can forgive them for their ignorance because they don't know any better, although I still won't do their homework for them. Anyone who is HS graduate should know better and should feel ashamed of himself for trying to cheat like that. What we need is a virtual arm that can reach out to their monitors and slap the offending person silly.

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

I was going to make this a reply to another thread but decided not to because it would have hijacked that thread.

My favorite ice cream is Dairy Queen, IMO the best danged soft ice cream in the world. Although I haven't tried other kinds the world over, but I'll boast about it anyway.

My least favorite is Baskins & Robibns, not because the ice cream is bad but its too expensive, not worth the money they want for it.

So, what is your favorite ?

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

>>array[ct] = "\0";
That is incorrect. The quotes should be single quote, liks this: array[ct] = '\0'; >>What I'd like to know is how to clear a 2D array in the same way
Yes, its done the same way.

char array[10][20];
for(int i = 0; i < 10; i++)
{
    array[i][0] = '\0';
}

The above only clears the first byte of each string, making them empty strings. If you want to clear all bytes of each string then you have a couple options:
1) add another loop inside the outer loop -- its called nested loops

2) clear the strings when initilzed, like this: char array[10][20] = {0};

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
#include <string>
#include <iostream>
using namespace std;

int main()
{
    string classname = "windows name";
    char* lpszClassName = classname.c_str();
}

Is the above what you are confused about?

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

classname appears to be std::string object. c_str() returns a null-terminated pointer to the object's string. You should study up on std::string

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

Those are your options -- take them or leave them. The other alternative is to use a gaming engine such as DirectX, but you need more C or C++ experience to use it. My suggestion is that you set this ambitious project aside for a few months until you get a good grasp of C++.

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

use threads. But I don't know if they are supported by your compiler. If not then next best thing is to call kbhit() (see conio.h) to see if a key has been hit. If it has, then call a function to process the keyboard data. If not then do the mathamatical operations. You will need to do this in a main program loop, something like this:

for(;;) // forever loop
{
    if( kbhit() )
    {
            // process keyboard data
    }
    // do math problems here
}

Do you realize there is an entire forum devoted to games ?

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

do you know how to search a linked list by using the next pointer? If you do, then its just call strcmp() on every loop iteration to find the desired node.

Am I going to do this for you? Answer: No.

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

Welcome. I don't know the first thing about phthon but there are other experts here that will help you out, so ask away in the phthon board.

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

You're just repeating the party line here ... You have completely missed the point.

After re-reading, maybe I did mis-interpret those statements. If I read the answers as if they were spoken from a pirate's point of view, then you are right.

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

i win in post count yay like 800 then im #1

Is that #1 Blabbermouth :)

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

I think that in a decade from now, high school textbooks are going to be referring to the War on Terror as WWIII.

WWI was supposed to be the war that ends all wars. It was the beginning of the end for the UK. Are we now writing our own destiney with this War on Terrorism? Will we (or are we now) going down the tubes because of this undeclared war? At a cost of $1Billion/day it won't take long before we're bankrupt.

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

I don't know the answer to your question either, but like all other Microsoft products the detail format of the file is a company secret. If you want to extract the information from the email file then you probably need to use Microsoft Office Automation SDK

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

Do the assignment one small step at a time. First create an array of the desired numbers. Get that compiled working first, then post the code you have done.

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

My guess is that you did not run the hardware compatability test program available at Microsoft. Most older computers and/or hardware (before 2001) will fail the test.

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

Yes -- buy XP Server and the number of desired licenses.

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

use setenv(), but it only works for the current process. When that process ends the new environment variable is reset back to its original state. The only way to make it permanent in the system is to change it via control panel.

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

Microsoft compilers do not use unistd.h -- that's for *nix. And Microsoft put an underscore in front of the name, so its _getcwd().. The link contains example code too.

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

>>Life does not come with a guarantee. You could work for me for two weeks and drop dead. Who would I owe? (No one.)
Yes you would -- you would owe the dead person's estate. If you don't pay up then his estate can sue you for the wages and anything else you might own him.

>>You work for me for two weeks, then I drop dead. Who would owe you? (No one)
Same answer as above, for your estate owes me the money and I can sue your estate if it won't pay up.

>>Maybe the work you've done for me is really of no value at all. Do I owe you for it?
doesn't matter what the work I did was worth as long as I fulfilled the contract I had with you. If I fulfilled the terms of the contract then you owe the money.

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

i get 60+ emails a day from daniweb about thread notifications lol

You can turn them off in Control Panel unless its an automatic message from a moderator.

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

>>but does anyone else feel like the new colorful $20 bill should be worth more than the old $20 bill.
I think all new USD looks like monolopy game money. They just don't look right.

>>My equation was long term.
Yes, you are right then.

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

you want to work with arrays. First create an array of 5 integers int array[] = {1,2,3,4,5}; Now its simple. The middle three numbers are array[1], array[2], and array[3].

Next, to get the largest and smallest numbers, just create a loop and check each array element

int largest = array[1];
int smallest = array[1];
for(int i = 1; i < 4; i++)
{
   if( largest < array[i])
      largest = array[i];
  // now do the same test for smallest
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If you work with Microsoft compilers and do any COM programming (such as for distributed processing and inter-language support) you will come across the VARIANT structure with is nothing more than a structure with two objects:

  • unsigned int type -- declares the type of data contained in the structure
  • union -- a uniion of a lot of different data objects, such as char, short, long, char*, etc

win32 api has several functions that work on the VARIANT structure, and there is a _variant_t c++ class that wraps the VARIANT and some functions.

As for your question, yes under some circumstances a function can return a VARIANT or _variant_t object.

#include <windows.h>
VARIANT foo()
{
    VARIANT vt;
    VariantInit(&vt);
    return vt;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

when compiling from a command prompt you need to set the PATH environment variable to include the compiler's bin directory or whereever the compiler's executable files are. you can do like this:
write a small batch file that contains this line SET PATH=%PATH%;C:\BORLAND\BCC55\BIN Then every time you create a command prompt you have to execute the above batch file. You can also just simply type it instead of writing a batch file, but a batch file saves time.

There is another way to make the change permanent, but how to do it depends on what version of Windows you are running.

>>void main
main ALWAYS returns int, so the only legal declaration of that function is int main() [edit]
>> I have also appended the path in the system variable with C:\borland\bcc55\bin
Oops. I didn't notice that statement when I wrote the above. Did you display the path to verify you did it correctly ? In older versions of Windows the path can become too long and attempts to add more stuff will fail.

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

According to Mastering Visual Basic 6 you have to explicitly declare the array dimensions and arrays can not be initialized like that. You have to set each element one at a time.

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

How do you recognize one paragraph from another? There is no standard way to separate paragraphs like there is to separate lines. So your first task is to clearly define what constitutes a paragraph.

Counting the number of '\n's is counting lines, not paragraphs. So you will have to think up something else or redefine the problem to count the number of lines in the file.

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

The stork story is in all the cartoons -- at least all the ones I used to watch when I was a kid.

I was raised on a farm. One day when I was about 10 I saw two chichkens getting it on when I asked my mother what they were doing. She blushed and never did tell me. To this day I still think it was the stork.

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

A big rock from outerspace will strike the earth and destroy all human life.

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

Why am i getting these replies?

:-->? wtf
:->Xsimulator.net, What did you have (heroine/coke/weed/?!?)

Sorry for this i thot this category was for entertainment !

It is for entertainment.

Moderators please delete this thread .

NO. We don't delete threads here just because you get chastized for saying something really dumb. And I had a big laugh at those comments :)

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

>>if (purchase<balance || purchase == balance)
change that to this: if( purchase <= balance) seekg() moves the file pointer xxx number of bytes. To accomplish this you have to calculate the offset from the beginning of the file, or from the current location of the file pointer. The start of the second account -- 101 -- is 11 + 2 for the line terminator "\r\n" pair in MS-Windows. When using *nix it is only "\n" and MAC its "\r". All those differences is why we don't normally use seek methods on text files even when the text files have fixed-length records. Now to advance to the beginning of the money field just add 4 to account for 3 digit account number plus one space.

A safer way to do it that is portable to all operating systems is to rewrite the entire file and replace only the line that changes.

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

please post code. I don't have MFC project is front of me, I think my previous post was incorrect. The original code is ok. Your problem is really something else because I used CStringArray successfully lots of times but not with your version of the compiler.

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

m_pMainWnd = &dlg; <<< wrong m_pMainWnd = dlg.m_hWnd; <<< correct assuming m_pMainWnd is type HWND.

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

>You need to #include <windows.h> in your resource script (digitron_rc.rc).

Nope. Didn't fix the problem. I copy/paste the dialog box rc stuff from the tutorial and it doesn't compile either.