Salem 5,265 Posting Sage

Do the files still exist somewhere with the original dates?
Because it's entirely possible to just get a list of filenames and dates from the old system, then update the dates of those same files on the new system.

Salem 5,265 Posting Sage

> Now, which presidents won the most wars?
I was thinking "started the most wars", but you got there first ;)

Salem 5,265 Posting Sage

http://clusty.com/search?query=credit+repair+scams&sourceid=Mozilla-search
You'll need to differentiate yourself from the wide range of scammers which also offer "magic credit repair", which only serves to transfer the "credit" into their own pockets without actually achieving anything of use for the client.

Salem 5,265 Posting Sage

Excellent first post - code tags, environment, statement of problem and example code. Everyone else should learn from this!

> strcyp (input1, default1);
Does this compile?
Isn't it supposed to be strcpy() ?

> the program will ignore (or seem to ignore) all of my "cin.ignore(1000, '\n');" and
> "cin.getline(input1, 31, '\n');" commands.
Or they could be returning error.
Check the return result to see if this is the case.

Salem 5,265 Posting Sage

> #define test(); #warning <windows.h> needs to be included for this function!
But if you don't have windows.h, then the code would have failed to compile before this point anyway.

How to tell your OS/Compiler/etc at compile-time
http://predef.sourceforge.net/

You have to do something like this

#ifdef _WIN32
#include <windows.h>
#else
#warning needs windows.h
// in case the compiler ignores #warning
int test ( ) {
  fprintf( stderr, "_WIN32 not set, compilation should have failed!\n" );
  exit( 0 );
  return 0;
}
#endif

Or if you're trying to spot obsolete functionality, and you're using gcc, then perhaps this (this is the 2nd obscure snippet from the gcc manual today :) )

deprecated
The deprecated attribute results in a warning if the variable is used anywhere
in the source file. This is useful when identifying variables that are expected
to be removed in a future version of a program. The warning also includes the
location of the declaration of the deprecated variable, to enable users to easily
find further information about why the variable is deprecated, or what they
should do instead. Note that the warning only occurs for uses:
extern int old_var __attribute__ ((deprecated));
extern int old_var;
int new_fn () { return old_var; }
results in a warning on line 3 but not line 2.

Salem 5,265 Posting Sage

smart questions

I'll leave you to figure out the number of places where [code] tags are mentioned, and as to why you failed to read (or heed) any of them.

Salem 5,265 Posting Sage

Remarks

GetFullPathName merges the name of the current drive and directory with a specified file name to determine the full path and file name of a specified file. It also calculates the address of the file name portion of the full path and file name

This function does not verify that the resulting path and file name are valid, or that they see an existing file on the associated volume.

> i am using findfirstfile() and findnextfile() to get the handles
I think you need to show some code.

Salem 5,265 Posting Sage

But if char array is all you have, and you're not compiling with UNICODE, then this (it would seem) would work just as well

AddFontResource(filename);

Salem 5,265 Posting Sage

I rather suspect they want a font design tool, to create a new font, with glyphs of their own design.
Having done that, they can then use that font in any program capable of using fonts.

Which, unless you intend to write said "font design tool" yourself, in C++, has very little to do with C++.

Salem 5,265 Posting Sage
Salem 5,265 Posting Sage

You could help us by reading the forum rules on how to post code :(

Salem 5,265 Posting Sage

> i have to submet my final project next week on 14/10 and i didnt star yet
Ohh, so 6 days to go then.

When did you get this assignment?
- today
- a week ago
- a month ago
If your answer is anything other than "today", then your failure is your problem, not ours.
Showing up at the last minute feeling repentant, hoping someone will save your ass from the coming fire doesn't work.

How about starting with a set of use scenarios, like
"Hello, I'd like a car please, sorry we have no cars available at this time"
etc

Salem 5,265 Posting Sage

"pong", for 4 players, over a network.

Salem 5,265 Posting Sage

No.
You'll have to use a temp file.

Or write the whole thing in perl, then you can do whatever you want.

Salem 5,265 Posting Sage

section ("section-name")
You then modify your linker script to place the section you gave to your variable, at the address you want it placed at.

Salem 5,265 Posting Sage

> capture2 = cvCaptureFromCAM( 1 );
It means this returned NULL.
It also means there was probably a problem with the call.
It also means that there's also probably an error function you can call to find out more about why it returned NULL.
If you RTFM for this function, and look at the "return result" section, see what it has to say about what "NULL" means as a result.

Salem 5,265 Posting Sage

http://www.daniweb.com/forums/thread149849.html
And turn the arrows to point the other way.

Salem 5,265 Posting Sage

line 23, trailing ;

Salem 5,265 Posting Sage

> player1 == ('R' || 'r')
Is not the same as
player1 == 'R' || player1 == 'r'

You might want to consider toupper() to halve the number of tests.

Salem 5,265 Posting Sage
Salem 5,265 Posting Sage

I don't think the pre-processor is capable of expanding lines which are themselves pre-processing statements.

In short, I don't think it's going to work.

Salem 5,265 Posting Sage

Real simple game, anyone can play it

int main ( ) {
    if ( rand() % 2 ) {
        printf( "You Win\n" );
    } else {
        printf( "You Lose\n" );
    }
}

> could anyone lend a program on me?
Lend?
When exactly were you planning to give it back?

Salem 5,265 Posting Sage

It looks good - does it work?

Salem 5,265 Posting Sage

How much research did you do between reading my reply and posting your reply?

Salem 5,265 Posting Sage

Because storing the result in a shell variable always strings out redundant white space.

If you want newlines, then pipe it direct. tripViolations=$($tripwire --check --quiet | awk '/Total violations found/ {print $4}')

Salem 5,265 Posting Sage

> will the first argument be the file name from which the program has been called?
Yes.
You can even use the registry to specify command line options if you wanted to.

Salem 5,265 Posting Sage

Your original code

if((mid*mid) > high)
        return square_root(low, mid);
        
    return square_root(mid, high);

If the test is true, you return the square root between low and mid, otherwise you return the square root between mid and high

Your commented code

if((mid*mid) > high)
        //return square_root(low, mid);
        
    return square_root(mid, high);

Which is really the same as this

if((mid*mid) > high)
        return square_root(mid, high);
    return ?;

Not only do you calculate the square root on the wrong half of the bisection, you return some garbage value if the test fails. I rather suspect that that is where your constant result is coming from.

When I mean add more { }, I mean like this

if((mid*mid) > high) {
        //return square_root(low, mid);
    }        
    return square_root(mid, high);

Now, whether you comment the line out (or not), the next statement will not be called instead simply because the test still passes.

It will on the other hand be called all the time (which is a slightly different problem), because there is now a return statement which is missing in the code.

In fact, adopting a single exit point approach means you're unlikely to unexpectedly fall off the end of a function because you forgot to take into account a possible return path. Seeing the "error" result in your code would alert you to the problem, rather than be left wondering what a particular "junk" result meant.

double square_root(double low, double high)
{
    double mid, result = 0.0; …
Salem 5,265 Posting Sage

http://en.wikipedia.org/wiki/Complex_instruction_set_computer
http://en.wikipedia.org/wiki/Risc

Hell, when I did this, I had to get out of my chair, walk to a library (y'know, where books are kept), look through index cards, more walking past lots of shelves, open a book and start reading.

All you have to two is type 4 letters into a search engine, and you can't even manage that.

Salem 5,265 Posting Sage

> What do you mean about not standard C anymore?
Meaning you can no longer pick a random C compiler (say for your Cray supercomputer or your mobile phone), and have your program work on all of them.

> Is it about making and using custom library?
Not necessarily. It could just be using the header files which describe the API of the OS you happen to be using. The Win32 API for example has many useful things which could be used to solve this problem.

Check out the console tutorials here
http://www.adrianxw.dk/SoftwareSite/index.html

Salem 5,265 Posting Sage

And what about the other line of commented out code further on?

Your lack of { } on your if statements is hurting you when you comment out code. It doesn't just remove that line, it changes the behaviour of the code which follows it.

Salem 5,265 Posting Sage

You commented out the calculation of mid (line 27)?
Line 28 won't even compile....

Salem 5,265 Posting Sage

"something wrong" is not a description.
There are plenty of coding errors which may be a problem in the end, but which may not be the most immediate problem.

Salem 5,265 Posting Sage

In the same way you count down the dots, count up in numbers.

Salem 5,265 Posting Sage

Without access to your platform, I've got nothing.

Apart from reading the manuals very carefully.
Focus on tcsetattr, tcgetattr and termios.

There may be some other thing you have to call, possibly right at the start of the program before you do any I/O (including printf).

Finding a forum specific to your platform may also help, if there is such a thing.

Salem 5,265 Posting Sage
Salem 5,265 Posting Sage

Nope - http://www.daniweb.com/forums/announcement8-2.html
You make an effort, then we help.

Salem 5,265 Posting Sage

No, you still need to advance through the list yourself. for ( current = H ; current != NULL ; current = current->next ) is another way of walking the list in a handy single construct.

Salem 5,265 Posting Sage

Very strange, that some programs compile fine, and the SDL can't even find the compiler.

Did you install it in the default place (c:\dev-cpp) ?

If not, then open the project file (.dev) in another text editor, and see if it has something dumb like
GCC=C:\Dev-cpp\bin

Also check the makefile.win using the same editor.
The makefile should just have the name of the compiler, not the path to it as well.

Salem 5,265 Posting Sage

Well if you had static char dbase then it would remember the state you left it in for next time.
But if you ever want to get back to the initial state, then you'd need to code that yourself.

> "abc\0","b\0","cde\0","d\0","ef\0","f\0"
You don't need those \0, the compiler adds them for you.

> return list2[5];
If you take the else, then you return garbage.
Whatever is the caller supposed to make of that?

You could probably simplify the code with strstr() and strcpy()

Salem 5,265 Posting Sage

> Why do i get this error every time i try to compile an SDL source code?
What about other programs, like a nice simple "hello world"?

It seems to me that you've downloaded the smaller zip file, containing only the IDE, and not the larger zip file containing the IDE AND the compiler.

Without the compiler, the IDE is just a dumb text editor.

Salem 5,265 Posting Sage
typedef struct{
        process *data;
        struct queue *next;
} queue;

The "struct queue" inside the typedef refers to an as yet undefined struct.

You need to name your struct, before you can point to it. Fortunately, this is easy to do, like so.

typedef struct queue_tag {
        process *data;
        struct queue_tag *next;
} queue;
Salem 5,265 Posting Sage

Which OS / Compiler are you using?

Sure it's possible, but it won't be standard C anymore.

Salem 5,265 Posting Sage

Now, if the damage to the US banking system had been done by some external agent, GW (bless his little cotton socks) would be declaring war (with a $700Bn price tag).

But because the damage was done by a bunch of brown nosing yahoo's from the old boys club, who'll kick back some of the slush fund back to the politico's, the US tax-payer has once again been plucked and stuffed just in time for thanks-giving.

Just remember who you're thanking, and what they've given you.

Salem 5,265 Posting Sage

> mov==getch();
> if(mov='d')//supposed to be right arrow, don't know how to
You got them both wrong
= is for assignment (the first one)
== is for comparison (the second one)

Salem 5,265 Posting Sage

http://www.activestate.com/Products/languages.mhtml
Perl is a scripting language, more akin to PHP than C

Whilst you can do web stuff in perl, it is a general purpose programming language which can be used for many other applications as well.

Salem 5,265 Posting Sage

Big Picture
Do you have any kind of a design for this assignment?
Because it seems like a large problem, one which isn't going to be solved just by bashing in random code until it works (because it won't).

Think about what your adjacency list class needs to provide
- create
- destroy
- add nodes
- print nodes
- remove nodes
- and so on...

When you have a class, write a simple test for it, something like

int main ( ) {
  myAdjList list;  // should call constructor
  list.add( 1,2 );
  list.add( 3,4 );
  list.print( );  // should see 1,2,3,4
  list.remove( 1 );
  list.print( );  // only 3,4 left
  // destructor called round about now
}

When you have a class which works, then you can use it in anger to solve your assignment, knowing that the basic components are going to work.

Do you need other classes, or just the one and a main() to sequence everything together?
If you need other classes, how are they going to interact with one another.

Draw some diagrams on paper, index cards, post-it notes to remind you of what the overall design of the program is supposed to be.

----- ----- ----- -----
Little Picture

As this appears to be C++, then use C++ I/O.

Eg.

int a, b;
char burnAComma;
while ( cin >> a >> burnAComma >> b ) { …
Salem 5,265 Posting Sage

> Return 0;
What do you return in the other case?

You've got too many node pointers. All you need to scan down the list is

while(current != NULL) {
    valueOfNode = current -> value;
    // do something with valueOfNode 

    current = current -> next;  // advance
}

Also, if you keep the end pointer of the list you're copying to, then that makes that part of the processing very easy as well.

Salem 5,265 Posting Sage

> and would really appreciate any help on this topic from someone who actually knows something about C++
I only said what everyone else was thinking.

Actually, what most people who know C++ on this forum were thinking was "Oh, another post without code tags, I'll go and do something else for a few hours, and see if a mod has fixed it". It doesn't matter, because all it does is delay responses to your ill-formed post.

Also, if you'd been paying any attention at all, you would have noticed on literally hundreds of posts on this forum, lines like this
Last edited by Tekmaven : 7 Hours Ago at 23:02. Reason: Code tags

Interesting that your other post, whilst it has code tags, is completely devoid of any indentation at all. Which is ironic given that your original in this post DOES have indentation.

But if you want to carry on explaining why you're so damn special that we should help you even though you ignore all the rules, then I'm sure /dev/null will be happy to listen to them.

Salem 5,265 Posting Sage

What does string sentence = firstWord + secondWord; do?

Salem 5,265 Posting Sage

> I only get 0's and garbage for the average.
Strange, I see several typos which would stop the program from compiling, nevermind running.

Did you copy/paste the source code from your editor (which would be good) ?
Or did you just retype the code here based on what you thought you have (which would be worse than useless) ?

> avg= totale/i++;
For example, there is no 'e' in total, not as you've declared it anyway.

> for( i=1; i<=7; i++);
Despite your indentation, none of the following code executes 7 times with that trailing ; on the for loop.
Even after you remove the training ;, you need to add a pair or { } to make your intented loop explicit.