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

You are reading the wrong tutotorial -- that was written for MAC, not MS-Windows. It's quite easy with VC++ 2010 Express or Code::Blocks, both compilers have start-up templates that generate appropriate code for you, then all you have to do is add your own code that you want to export from the DLLs.

Ditch that old, ancient Dev-C++ compiler that hasn't been updated in a couple centuries and get either of the above two mentioned compilers.

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

If you wrote the program then why don't you know about the username and password?

frogboy77 commented: valid question +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Where to begin what? If you want to know how to bake an apple pie then you are in the wrong place.

Nick Evan commented: :) +0
jonsca commented: I'm looking for a good recipe if you have one +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Maybe he meant typecasting ?

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

Reading the input stream is the only standard way to do it. That means you have to dynamically expand the input buffer with realloc() while reading the input stream.

vedro-compota commented: +++++++++ +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Go to bed, get some sleep, then work on it tomarrow when you have a fresh mind. Afterall, if you can't be bothered to study that link that I can't be bothered to tell you how to do it.

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

line 13: you are incrementing i too soon which is causing theThreads[0] to be an uninitialized variable. Move that line down to line 19.

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

Sure -- here's one. If you are asking me to do your homework for you then you can forget it.

#include <iostream>
using std::cout;
using std::cin;

int main()
{
  // pur your code here
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

mine is to stay alive long enough to see 2012

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

I put it at the top of the *.h file

#pragma once
#include "Window2.h"
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Did you add #include "Window2.h" at the top of that file? I just compiled the code you posted and did not get any erors or warnings, and it ran just as I expected it to run.

TSims11 commented: He pointed out something I was too dumb to figure out. +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Well there you go. You are trying to drive on an interstate, freeway or autobahn with a Model T car built in 1910. You are using a 16-bit compiler that has very very limited memory and stack space. Sorry, but there is nothing you can do to fix your problem without switching to a modern 32-bit compiler or reducing the size of those arrays.

jonsca commented: Yes! +6
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The maximum value of register ax (and other similar 16-bit registers) is 255. Any register can be treated as either signed or unsigned. So 255 is the maximum of unsigned while 126 is the maximum signed.

Registers do not contain instructions -- only data. mov, jmp, cmp, etc are instructions.

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

The third line should be W2->Show(); -- needs the parentheses.

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

managed c++ does not use new -- it uses gcnew. And you have to make W2 a pointer. The braces are unnecessary.

Window2^ W2;
               W2 = gcnew Window2;
               W2->Show;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Those numbers are the data types. They should be defined in one of the header files you have to include in your program. Here is a complete list.

kvprajapati commented: Hi! Happy New Year! Sir. :) +11
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Will not make any new years resolutions.

jember commented: hahaha! Nice one! xD +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

In Dev create a c++ project then just add all the *.c and *.cpp files to it that you want. Dev-C++ will do all the rest for you, you don't have to do a thing.

But I would suggest you replace Dev-C++ with Code::Blocks because Dev-C++ is old and has not been updated for quite a few years not.

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

Happy New Year -- we still have 2 hours to go :) Years ago when I was a young lad it was fun to stay up at night and watch all the parties on TV. They don't do that any more, it's so boring now.

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

>>answer immediately please

Demanding immediate response is considered a very rude comment, which is probably the reason you got a negative rep for your post.

Nick Evan commented: It is indeed. +16
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If you are using Turbo C then most likely delay() is in dos.h. But if you are using a modern compiler then there is no such function. MS-Windows has a Sleep() function and *nix has sleep().

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

when line 25 returns NULL then line 26 is going to cause a lot of grief. You need an if statement between those two lines.

if( (start = strchr(line,'$')) != NULL)
{
   // blabla
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

So what does your homework asignment have to do with converting cout to printf()?

You will need to extract each digit of the number and then print only that digit. The mod operator % and divide / will help you do that. The mod operator returns the remainder after division, so if the number is 1234 then 1234 % 10 will give you the 4. Next divide 1234 by 10 to make the number ready to retrieve the nedxt digit -- 3. Repeat that process in a loop until all digits have been extracted and printed.

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

Your program can create a file anywhere it wiches as long as it has the permissions needed to do that. You can't create a file in a directory where you don't have write permissions.

Or are you trying to ask if you can put the path in a file and read the path from that file. For example, if you have file named ./path that contains "/User/Joey/Desktop/". The answer is again yes, you can easily do that. Just read the file into a variable the use that variable in the call to fopen()

Joey_Brown commented: Gr8 guy !! +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That '|' sign is called a cursor. If you want win32 api GUI program then there are cursor functions, such as GetCursorPosition()

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

time() returns the current system date/time in seconds since about 1 Jan 1970 (epoch time)

localtime() will return a tm structure based on the time_t value that was returned by time() or other similar function.

ctime() returns a character array based on the contents of struct tm that is passed to ctime()

Briefly

time_t now = time(0);
struct tm* tm = localtime(&now);
char* s = ctime(tm);
Nick Evan commented: Short & sweet +16
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

When you start the program it sets the current working dirfectory to the folder which clontains the source files. So if you put that file in the debug folder then you copied it to the wrong folder. Put the file in the same folder as the *.c and *.cpp files.

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

Since a shell is a user-interface to the os I suppose there may be versions of *nix which run without a shell and without human interface. I think those would be pretty rare cases.

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

Jesus just give the people what they want write the fucken code for them, or better yet since the douchebags on this forum don't want to give the answer go to cramster where they will write the code for you

Oh that's a great way to teach people how to program. I suppose if you every get a job you will expect eveyone else you work with to do your work for you so that you can sit on your ass and play with yourself.

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

You can use / in both MS-Windows and *nix. C:/foo/bar.dat

If you still want to use \, then the only time you need \\ is in string literals which are surrounded by quotes. Paths read from a file or returned by some other function do not need \\.

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

In C and C++ there is a register keyword, but most (if not all) compoilers just ignore it for reasons previously stated. And even then register can not be used with global variables.

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

Is that function a member of a class? If yes, then in the *.cpp file you have to identify the namespace in which it appears as well as the class name, something like this:

#include "contacts.h"
namespace MyNamespace // or whatever its called in the *.h file
{
   void MyClass::loadCustomerDetails()
   {
     // blabla
   }
}
kvprajapati commented: AD, Its Managed VC +11
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The reason is that there are only a limited finite number of resigers available to the program. For example on Intel and compatible processors there are only 6 register variables in common use throught the program (eax,ebx,ecx,edx,esi and edi), so it would be impossible to store global variables in them.

vedro-compota commented: +++++++++ +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If your program is calling OpenFileDialog() then you need to set the RestoreDirectory property to TRUE so that it does not change the current working directory on you.

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

There is no such thing as a pure OOP c++ program. There are only two kinds of programs: event driven and procedural. MS-Windows GUI is event driven where someone clicks a button and the program responds to it. Console programs are procedural where they just run from start to finish, with a few loops and threads tossed in between the two ends. Both types can contain a few OOP concepts, such as classes, but that is about the extent to which c++ supports OOP.

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

Yes, you can create the program, but VC++ can not compile for platforms other than MS-Windows and a few embedded devices. IMO if you need the program to be compatible on both MS_Windows and *nix then use Code::Blocks with MinGW on MS-Windows and Code::Blocks with g++ on *nix. If you want to write a GUI program then use QT for cross-paltform.

Kieran Y5 commented: Making me happy ;) +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Don't use Dev-C++ -- its and ancient and unsupported compiler/IDE. Much better if you get Code::Blocks which uses current version of MinGW compiler. Here is a tutorial

Fbody commented: Agreed. +4
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Questions about DaniWeb go in DaniWeb Communicty Feedback

Agapelove68 commented: Thank you for being helpful. I appreciate the tip, where to post my questions with, "How do you...?" oops you misselled community, but I navigate there. :) +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

first create a structure to hold all the information from one student.

Next you will have to know how to open a file and read it, most likely one line at a time. If you don't know how to open a file and read it then you need to study your textbook about FILE, fopen(), and fgets().

Finally you will need to know how to create a linked list of those structures I mentioned above. Again, your text book will show you how to create a linked list.

After you have started writing your code, you can come back here, post the code you have written, and ask specific questions about what you don't understand.

vinitmittal2008 commented: Fully Agreed.. +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 46 does not require use of new because bar is not a pointer. This is all that line 46 needs to do. bar b(fc);

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

Ignore the vector part and concentrate on how it recognizes a new sub directory and makes a recursive call to process the files in it. In C language I would replace that vector with a linked list if you need to keep the list of all files in memory for some reason.

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

Or to avoid costly addition operations

for (j = 0; pTemp[j] != '\0'; j++,i++)
      pWord[i] = pTemp[j];
   pWord[i] = '\0';
vinitmittal2008 commented: useful info! +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

How do I expand and collapse this? I've tried the arrows to the upper right corner and nothing happens.

Just hit the Post Reply button

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

You could write it with c++ and use QT, which is a cross-platform GUI compiler.

benqus commented: thank you! =) +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>because the compiler prints the
Don't blaim the compiler for the code you wrote :) The logic of your program is flawed.

scanf("%c" expects you to enter an alphabetic character, such as 'D'. The switch statement is checking for numeric data, such as 0, 1, 2, ... Since you used scanf( with %c that switch statement must check for the numeric values of the character, such as '0', '1', '2' etc. Note that using < and > doesn't mean much with that because, if you look at any ascii char you will see that there are NO characters < 0 and they are all > 0. Finallly, its ot possible to eter a negative value with %c.

Kamatari commented: Righto +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What???

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

int main ()

{
    int Tab[5][3]={0}, i, j, sum = 0, largest_sum = 0;
    
    for(i = 0; i < 3; i++)
    {
        for(j = 0; j < 5; j++)
        {
            scanf("%d", &Tab[j][i]);
        }
    }

    for(i = 0; i < 3; i++)
    {
        for(j = 0; j < 5; j++)
        {
            printf("%d\t", Tab[j][i]);
        }
        printf("\n");
    }
   largest_sum = 0;
   for(j = 0; j < 5; j++)
     {
       sum = 0;
       for(i = 0; i < 3; i++)
          sum += Tab[j][i];
       if( sum > largest_sum)
            largest_sum = sum;
     }
    printf("\n %d",largest_sum);
    
  return 0;
  
 }
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You need to find out what PVOID is defined to be. If it's not defined to be anything, such as define PVOID then the compiler will produce C4430. If you don't know what C4430 error is then look it up with google.

>>HAPTIK_DLL_IMPORT_EXPORT
Your program need to define that symble to be either dllspec(__import) or dllspec(__export) depending on whethere you are declaring it in a DLL or the application program that uses the DLL. Just putting a semicolon after it like you did is not the correct solution.

claudiordgz commented: Awesome response +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

People who break the laws are more than just "disobediant" -- they are criminals. Just because you don't like a law doesn't give you the right to disobey it. Are there laws that shouldn't exist -- Yes, but the way to get around it is to change the law, not break it.

It sounds to me that you are much less intelligent that what you think you are. Breaking laws is not a very intelligent thing for you to do.

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

You could do this

class something
{
   public:
      char attribute1[25];
      char attribute2[25];
      donkey(char* a, char* b)
      {
          strcpy(attribute1,a);
          strcpy(attribute2,b);
      }
      donkey(){}
};
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

google is you friend, learn to use it. Click here

geojia commented: Haha, Very NICE! +1