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

graphics.h is not supported by any *nix compiler -- it was developed for Turbo C on MS-DOS 6.X and older operating system. So you might as well forget about trying to use graphics.h on *nix or with g++ compiler.

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

You should talk to your school consoler because only he/she will know the difference at that school. All we can do is guess.

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

Turbo-c console program? No. You have to use the font size that is built into your computer. To change font sizes requires a graphics program, and then you have to either create the fonts yourself of get the fonts from someone else.

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

If it works on a PC in US and Canada, why wouldn't it work on a PC in UK?

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

runtime error: an error that occurs then your program is run such as division by 0, buffer overruns and corrupt stack. There are an infinite (or nearly infinite) number of these errors so its not possible to list them all.

compile time error: errors that your compiler produces when it tries to build the program.

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

1. The parantheses means type casting -- converting one type of pointer into another. You will see that syntax quite often in C programs. One way to easily find out how things work or don't work is to try it in a very small program. If you omit the parentheses the compile will not know what to do with the "char" part of the typecast.

2. *pointername is dereferencing the pointer, or looking at the value in the address contained in the pointer. Without the asterisk its only using the name of the pointer.

int *pointername; // declares a pointer
int x;
pointername = &x; // set pointername to reference a variable
*pointername = 0; // assign the value of 0 to integer x.
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

@yatender123: Its not likely you will get anyone to do that for free. Post in Paid Job Offers forum and offer some reasonable $$$ (money)

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

Here is an interesting thread about the topic of individual rights to own and keep weapons in the USA. The original intent was to give evey American citizen the right to have weapons so that he can defent himself, his family, his home, and his country against foreign invaders (like England) or other people who intend to do harm. And that today is still the main reason. Americans are paranoid about any one or any nation enslaving them.

December 15, 1791

George Washington <former US President>: "A free people ought not only to be armed and disciplined but they should have sufficient arms and ammunition to maintain a status of independence from any who might attempt to abuse them, which would include their own government."

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

Yes I know that, but how does that relate to changing the time on the computer?

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

What operating system? fork() is not supported on MS-Windows and your school computer is probably running *nix.

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

maybe what will be Sleep()? Do you know what you are talking about?

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

Read the link I gave you -- it will tell you everything you need to know. Just include windows.h in your console program.

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

Use your compiler's debugger and step through the program to see what it is or is not doing. Then tell us what function(s) has the problem. I, for one, am not about to read all that code and debug it for you.

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

Nice going -- but you are three years too late :)

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

If you have not learned structures yet then just ignore that part of my post.

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

>>Does it matter which one?
No. You can use either, but integers are most common. If you use char then the compiler will have to take the time to promote it to an integer before its used as the index into the array. So you can speed up a program by a few nanoseconds by using ints instead of char.

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

>>Does this mean that int and char are not objects?
Yes -- they are not objects. They are data types. A string is not an object either. It is a c++ class that is defined in <string> header file. Objects are an intstance of a data type or c++ class

int x; // x is an object
std::string name; // name is the object
char address[255]; // address is an object
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Keep the blacklist in a vector of strings, then use a loop to compare the name entered by the user to each of the names in the blacklist. vector<string> blacklist; If you want to ignore case, then convert all names to either upper or lower case, whichever you want, so that you can make case insensitive comparisons easier. There is no function that converts entire strings, so you have to loop through the string one character at a time and convert them using either toupper() or tolower()

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

I think you should be counting the number of paragraphs and the number of lines in each paragraph at the same time so that the program only reads the file one time. Just increment a line counter each time getline() is called.

Use a structure to hold both the pragraph and line count, then make a vector of those strutures.

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

To change the time on your computer is operating system dependent. If you have a modern computer then you will have to use a modern compiler so that it can access os api functions. On MS-Windows you will use SetSystemTimer()

As for the batch files, call system() function.

abhijeet kamble commented: good +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What do you consider an old thread? One hour, a day, month, year? Seems to me it would be better just to close them, but that topic has been discussed here before.

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

For MS-Windows GUI then www.codeproject.com is a wealth of free code, libraries, DLLs and tutorials. Probably the largest repositories of code on the net.

Lusiphur commented: Thanks for the reference link :) +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

There are several tutorials out there. Just google for "masm tutorials".

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

In Turbo C, I observed that the code size for initialized or uninitialized variables is the same.

Some compilers are smarter than others :) Turbo C is not a very smart compiler.

>>if both are same,why is there a difference in code size in both cases
What I meant by that is int x; and int x = 0; when declared on global memory are the same, in both versions the compiler initializes the variable to 0.

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

The compiler doesn't really put all the memory for objects in uninitialized global variable data space, only enough of the memory so tht the linker can resolve all addresses. The memory for them is allocated then the program is loaded into RAM. The compiler can't do that if you initialize the variable like in your second code snippet.

BTY: Uninitialized global variables are initialized to be all 0s when the program is loaded into memory (this is part of your program's startup code that the compiler adds before calling function main). So the code in your second code snippet has no value.

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

Actually not. I installed Ubantu and I had to install g++ separately. So I suppose some distributions may install g++ by default while otheres do not.

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

What makes you think I am a moderator?

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

As for being your equal -- thank God that I am waayyy above that. You have shown us all very clearly that you are nothing but an arrogant asshole who is acting like a 10-year-old spoiled brat. Go back home to your mommy and leave the programming to us big boys and girls.

As for deleting your accout -- Dani does not allow that under any circumstances. If you no longer wish to be a member of DaniWeb then just stop posting.

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

You need to read a tutorial about win32 api programming. Here is a very popular one. Do all the exercises in that tutorial and then you will understand the code you posted.

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

post code, I can't see your monitor from where I am setting.

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

google is your best friend.

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

Anything you want. GUI? games? networks?

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

There are many win32 api functions that can be called from plain C

#include <windows.h>

int main()
{
    MessageBox(NULL,"Hello World","Hello",MB_OK);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You need to start learning ODBC in C from a tutorial. Lots of them on the net, including this one. Its a lot more difficult than what you knew in VB, so be patient and study the tutorial.

There are a few c++ wrapper classes to make it a little easier for you. Just google for them and you will find them. Some are free but some are not.

And for the record VC++ is not a language. Its just an IDE and compiler which lets you write standard c++ and c code. You shouldn't confuse the two.

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

You should be aware by now that you can only put executable code inside a function. push_back() is executable code. vector<string> words is just an object declaration and can go either inside a function or globally outside a function.

Think about what you are doing, instead of just randomly tossing ink at a piece of paper and hoping something useful will result. Much like the infinite monkey theorem

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

5.6 is not talking about returning multiple values but coding multiple return statements

if( condition1 )
   return 1;
if( condition2 )
   return 2;
// etc
crapgarden commented: great answers! +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Here is an article about it

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

6 hours? OMG next time use google! Here is how to do it.

wchar_t wname[255];
std::string name = "John";
size_t convertedChars = 0;
mbstowcs_s(&convertedChars, wname, sizeof(wname)/sizeof(wname[0]), name.c_str(), _TRUNCATE);

IGUIEditBox* player = env->addEditBox(wname, rect<s32>(170, 80, 320, 100));
cwarn23 commented: Life saver +5
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Haven't you been reading your textbook? Or are you just browsing through a few horrible on-line tutorials?

use std::cin to get keyboard input

std::string name;
std::cout << "Enter your name\n";
std::cin >> name;

As for the calculations: you will have to post some code that shows us what calculations you need to do.

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

use setw() to set the width of a column cout << setw(20) << name << setw(4) << pay // etc. etc

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

>> input[0] = toupper(input[0]);

And what will happen if the first character is white space?

#include <iostream>
#include <string>

int main()
{
    std::string line;
    while( std::getline(std::cin, line) )
    {
        std::string::iterator it = line.begin();
        for(; it != line.end() && isspace(*it); it++)
            ;
        *it = toupper(*it);
       std::cout << "\"" << line << "\"" << '\n';

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

Learning from online tutorials will only get you a small part of the way to your goals. You can start there, but eventually you will have to invest some $$$ (money) to buy a few good reference books. Ultimately if you want to make programming a career then you will need a college degree.

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

That pretty much sums up my opinion of Java too :)

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

>>if I use Gnode* first1 in the class declaration is it as same as the first1 that I declared in class Glist?

I already told you -- they are NOT the same.

>>I think you said that instead of Gnode* first1 I have to use forexample Gnode* node to start printing from first1.Is that true?
I didn't (or don't think I did) say that. You have to start the recursive process from somewhere outside that print() function, like in main() or from some other function in Gnode class.

int main()
{
   Gnode n;
   n.print(n.first1);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Read up on how to declare functions. Parmeters have to have a data type as well as a name, something like int foo(int n) the variable n in the parameter has data type of integer. In your program the compiler produced the error because you forgot to add the data type for the parameter.

You coded it correctly in the second code snippet you posted (function implementation code). You just made the omission in the first code snippet (class declaration).

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

Use [code] ... [/code] tags -- they will add line numbers for you so that you don't have to do it yourself.

You said the function returns just a single character yet you are trying to return a character array. You can't have it both ways. What you should have done is char* getEmpName()const -- notice there is a * after char to indicate it will return an array of characters.

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

Well, you could start by renaming the argument to avoid confusion (you, not the compiler). void print(Gnode* node); In the class declaration it doesn't really matter what you call it -- the important thing is that you have to give it a data type. Name the variable anything you want.

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

LOL :) Yes I can do it, but I won't. And I doubt anyone else he will do your homework for you either.

jonsca commented: Sure, sure, we all know you're just ironing out the basics now, AD +4
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Procrastination?? You deserve to flunk that assignment.