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

>>but was the same..
You mean the convert was the same as without convert? If that is true then the 105 must be the wrong format specifier. I don't have the books so you will have to look up the format you want.

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

It doesn't work because planeamento table is not in the FROM clause. Correct the query by specifying the planeamento as you did in other places CONVERT(char(20), planeamento.dt, 105)

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

A KVM switch works very well, I've used it to control four computers with one keyboard, one monitor and one mouse. But don't expect them to last forever -- they wear out eventually and you will have to buy another one.

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

AD - you are a mod - can't you move this thread to somewhere more appropriate?

I agree but we don't really have a better place for this.

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

- At home, one compressed file format the unzip software responds to has the same file extension that a piece of music recording software I have uses for music encoding files. I had to uninstall the zip application from Windows to keep it from destroying the music files.

God thats a terrible reason to uninstall the zip program. The simple solution is to unzip files in a different directory. WinZip allows you to unzip files anywhere you want to, or even create a new directory for them, and I suppose all other zip programs do too.

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

dump that compiler and get VC++ 2008 Express because Microsoft fixed all of them. You no longer need to get the Windows Platform SDK or do all that manual setup in order to compiler MS-Windows programs.

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

xyz = *(long *)abc; That works when you KNOW that the character buffer contains the binary value of the long integer. For example

int main()
{
    char abc[10] = {0};
    long xyz = 123;
    memcpy(abc,&xyz,sizeof(long));
    long xxx = *(long *)abc;
    cout << xxx << "\n";
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you flush it right after cin

cin >> choice;
cin.ignore ( std::numeric_limits<std::streamsize>::max(), cin.widen ( '\n' ) );
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I'm still not sure what you want -- "@\n@" is the line terminator ? Instead of just '\n'? So that '\n' all by itself is not a line termiator. The only way I can think of at the moment to do that is to read the whole file as binary file into a character buffer then parse it yourself.

Someone once mentioned that perl scripts can be called from c++, but I don't know how useful that would be to you.

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

I usually hang around here most of the time, but I created a MySpace account just today. Haven't figured out what to do with it though :)

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

yes -- getline has a third optional parameter that is the deliminator. This should work, but I haven't tested it. getline(fin, line, '@');

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

Welcome to DaniWeb, Crabby. Meet Grumpy, also from you part of the planet.

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

>>cin >> (choice,'\n');
What is that? All you need is cin >> choice; Since choice is a single character you might also have to flush the input buffer with all remaining characters so that the next cin will work correctly. See this thread that Narue wrote about how to do that.

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

jephthah's suggestion works very well, except when there are braces within quotes. The macros used to find matching quotes will treat quoted braces as one of the matches. And that sucks. I wind up replacing quoted braces with something else so that I can easily restore them later.

jephthah commented: i learn something new every day. +2
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Welcome to DaniWeb. There are several old-timers here, so you will fit right in.

>>Am I in the right place?
Absolutely :)

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

>>For an example look at this site: http://svenskaspel.se/pl.aspx?PageID...&parentid=4373
That link is useless to most of us because its not in English.

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

Another way I have used to find missing braces is to comment out large blocks of code until the error goes away. You can narrow down the problem that way.

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

You will have count the braces. For each { there must be a matching }.

>>OK THIS IS THE ENTIRE THING, HOPE SOMEONE CAN SEE WHAT IM MISSING
Just look at the last line of the code you posted. The code isn't all there because the last function is not complete.

And please use code tags the next time you dump all that code here. Here is how to do it.

[code=cplusplus] // your code goes here

[/code]

Also please read this thread.

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

isn't it obvious what your program is missing? There error message said it all -- the { and } do not match. I can't tell you which one is missing because you didn't post all the code.

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

And so does everyone else.

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

WinZip -- which most everyone who does anything worthwhile uses

ACD FotoCanvas Lite 2.0 -- open photos and scanned images so that I can convert them to another format

CDBurnerXP

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

you could write your own version of new, delete, malloc, realloc and free then keep track of memory usage yourself. If you are running MS-Windows you could view the memory usage in Task Manager.

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

FILE is used for C? What's the C++ way to do file I/O? fstream? If so, I guess I just don't like using the overloaded >> operator, but I suppose I could call the function directly if I wanted to.

when coming from C background fstream does take a bit getting used to, but your program could be reduced to this:

ifstream in("filename.txt");
   in >> sprite_filename
       >> trans_r
       >> trans_g
      >> trans_b
      >> width
      >> height
      >> numFrames
      >> numCols
      >> frameChangeDelay;

The above is certainly a lot less typing than all those calls to fscanf(), and less prone to coding errors.

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

>>Any Ideas as to why it doesnt recognize df?
Its a scope issue. You declared it locally in Void button_run_Click(), so its not visible in function delegate_function_callback().

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

>>Oh but yes you are. file is supposted to be a pointer to an open FILE object.
I am writing to file? Aren't I just reading from it? file is declared as FILE* in another part of the code.

Yes, my mistake. as long as file was opened for either read or read+write.

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

>>(i know it isn't c++)
then why did you post it in the c++ board?

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

as I said, the code I posted is untested. Here is correction which works. I removed the array of authors for simplicity, so you will have to add them back into the code.

void add(string title, string author, int nAuthors)
    {
	    // new node required
        book *q = NULL, *t = NULL;
	
        if (p == NULL)
        {
            p = new book;
            p->title = title;
            p->author = author;
		
            p->link = NULL;
            p->numAuthors = nAuthors;
        }
        else
        {
            book* save = NULL;
            q = p;
            while (q != NULL && q->title < title)
            {
                save = q;
                q = q->link;
            }
            t = new book;
            t->title = title;
            t->author = author;
            t->link = NULL;	
            t->numAuthors = nAuthors;
            if(save == NULL)
            {
                // add new book at the beginning of the
                // linked list
                t->link = p;
                p = t;
            }
            else
            {
                // add new book somewhere in the middle 
                // of the linked list
                save->link = t;			
                t->link = q;
            }

        }
     }
daniel88 commented: Pure, unadulterated genius. +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The code I posted is just an extraction of your post, after the else statement that begins on line 18. I added line numbers to your code so just refer to your original post.

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

>> since the only other variable on that line is file, and we're not writing to it.

Oh but yes you are. file is supposted to be a pointer to an open FILE object.

>>sprite_filename
You have not allocated any memory for fscanf() to save the characters. Needs to be either allocated with new or statically allocated char *sprite_filename = new char[255]; // Or this char sprite_filename[255];

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

Dr. Who is IMO the all-time best sci fi series ever shown on TV, even outshining Star Trek. The movie made by 20th Century Fox Television, however, was a disaster.

As for the authors: Dr Who -- I don't know who can be considered the author because I think it was a collaberation of several writers.
Star Trek was of course Gene Roddenberry.

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

If the list only needs to be sorted by book title then just insert new nodes in sorted order. I didn't test this but it should work something like below. You have to save a copy of the previous link when iterating through the list so that the program can back up one node. If you had a circular, 2-way linked list you wouldn't need to do that.

book* save = p;
q = p;
while (q->link != NULL && q->title < title)
{
      save = q;
      q = q->link;
}
t = new book;
t->title = title;
t->author = new string[nAuthors];
		
for (int i = 0; i < nAuthors; i++)
    t->author[i] = authors[i];
t->numAuthors = nAuthors;

save->link = t;			
t->link = q;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>for a currency converstion program but I am unsure if I am doing the same thing with this one.

I don't know what you did before, but it appears all your teacher wants you to do is write more pseudocode, you don't have to actually write the two programs.

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

Welcome to DaniWeb, Al. Hope you enjoy yourself here.

Stuff you Dislike: Pain, people who have no ethics, people with bad temper and who are loud, inconsiderate jerks

Happily I have not met very many people like that :)

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

still the same problem as before, but all you did was move it around a bit. What exactly are you trying to do ? I know you want to use double pointers but what is the object of the code you are posting ?

If you are attempting to create a 2d array then do it like this:

Example **object = new Example*[2];
for(int i = 0; i < 2; i++)
   object[i] = new Example;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

try reading some of these gogle links

It would be a lot easier if you first export the excell file into a *.csv file because csv file is a plain text file that can easily be manipulated using C, C++, or any other computer language.

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

It doesn't work because line line 23 object2 is a null pointer. The declaration on line 13 is hiding the declaration line line 6, so line 13 is not allocating memory for line 6. Also, line 15 is making the array of NULL pointers.

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

just put lines 28 and 29 in a loop. After line 29 add an if statement to validate data imput. If its ok then exit the loop.

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

>>Is there any classes/ built in methods for this.
No

>>Is this very difficult things to do in C++ ?
Depends on your experience. What is easy for me might be very difficult for you.

>> Do I need any Add-In:s to C++ etc.. to be able to do this.
Depends on your compiler and the operating system you are using. For MS-Windows you can use win32 api graphics drawing functions. One place to start is this link.

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

>>Is NCurses compatible with C++?
yes

>>If so, how do I get a program started in it
Instructions here

>> Is it just like a library where I include it as a header file after linking to an install directory
Yes.

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

According to the spacing of the code you posted it is missing a close bracket } after line 8 and before line 10 so that lines 1 thru 8 are contained within the if statement starting on line 1.

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

I really don't know a hill of beans about blogs either. I thought a blog is just a plain text file which is posted on someone's web site, such as DaniWeb's blog board. You could write it with Notepad.exe (on MS-Windows) if you want to.

Or, is Garud actually talking about how to create a web site that supports blogs ??

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

just call modf()

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

When I consolidated all those 50+ globals into one *.cpp file I found several errors that had gone undetected, such as an integer with the same name had been declared globally in about three different files and god only knows what the compiler did to resolve that problem.

This program was written before function prototypes became popular. After taking the time to make a header file that contained all the function prototypes the compiler was able to identify several places in which function calls had either the wrong parameters or missing parameters. Function prototypes was another very major improvement.

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

It works with cin and cout too.

// test1.cpp
#include <iostream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
    cout << "Hello World\n";
	return 0;
}
// test2.cpp
#include <iostream> 
#include <string>
using namespace std;

int main()
{
    string line;
    getline(cin,line);
    cout << "\n\n" << line << "\n";
    return 0;
}
// command line

D:\dvlp>test2 | test1


Hello World

D:\dvlp>
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

No woman should be the president of USA, not because i am against any woman and all that stuf. But i think to keep a hold on oil producing country and to control terrorism, USA will have biggetst effect in future, and so we need one who can take good strict decisoin!

White men have been screwing up this nation for the past 250 years, its about time someone else gets the chance, and someone who doesn't have one foot in the grave and the other foot slipping :)

jasimp commented: exactly +7
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Welcome to DaniWeb Mike. Sorry that I can't help you but I know there are several experts here that will be more than happy to help you out. Our Web Development and Site Management boards are probably just what you are looking for.

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

>>It is actually an 32 bit C/C++ compiler
What compiler are you using and on what operating system ?

Are there other system resources that are being consumed and not released, such as file handles, or graphics gui objects.

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

>> What's the problem here?
Nothing. Your program produced expected results for me. I used VC++ 2008 Express.

That was incorrect. I actually got the same results that you did.

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

what you're NOT going to find is evidence of "misbehavior" in an ANSI C library.

Yes, I agree. Those functions have been around for quite a few years not and testest by millions of programmers all over the world. The likelyhood that anyone will find a bug is next to zero, unless you are using some newfangled compiler that has not been well tested.