one place to get the documentation is google man pages.
google man printf
Another place is the links in this thread
one place to get the documentation is google man pages.
google man printf
Another place is the links in this thread
*nix often does not run on the same hardware as MS-Windows. For example we have a lot of linux systems that run on Sun workstations with RISK processors (I think they are RISK)
I think it worked ok for me. I can't read German so I guessed at the prompts. Below for Jan 2000
Dieses Programm errechnet den Wochentag, des ersten Tages im Jahr, den Wochentag
im Monat des Jahres, die Woche, mit der der Monat anfaengt
Die Woche mit dem der Monat endet und die Anzahl der Wochen im Monat.
bitte geben sie das Jahr und den Monat ein, in denen die o.g. Daten angezeigt we
rden sollen
Anschliessend wird der Kalender des Monats angezeigt
bitte geben Sie das Jahr ein: 2000
bitte geben Sie nun den Monat ein: 1
das Datum ist gueltig
der erste Tag des Jahres, 2000ist der: Sa2000
29
1999
28
der erste des Monats liegt in der: 52Kalender woche
2000
29
der erste des Monats ist der: Sa
die Anzahl der Wochen in dem Monat betraegt: 6
die Woche in der der Monat endet ist die Woche: 57
Wo | 52 1 2 3 4 5
-----------------------
Mo | 3 10 17 24 31
Di | 4 11 18 25
Mi | 5 12 19 26
Do | 6 13 20 27
Fr | 7 14 21 28
Sa | 1 8 15 22 29
So | 2 9 16 23 30
Press any key to continue . . .
now that you have posted the problem, what exactly do you expect of us? We will NOT write your program for you but we will help you to write it yourself. So post your code and ask questions.
If class A and B are your classes, I would create class C to be the base class of A and B, then
class C
{
// blala
};
class A : public C
{
// blala
};
class B : public C
{
// blala
};
vector<C*> ops;
A* a = new A(.....); A is a user defined class
ops.push_back(a);
B* = new B(.....);B is a user defined class
ops.push_back(b);
Pseudocode for keyboard input: when loop finished cx contains the integer
clear cx integer
start of loop
get key from keyboard
is key <Enter>
if yes, exit loop
add key to cx then subtract '0' (decimal 48)
jump back to top of loop
int function 08 will read just one key from the input keyboard and wait if no key is available. So if I type "12 <Enter>" that is three keys -- '1', '2', and <Enter>. If you want the user to type more than one key then you need to write a short keyboard handling function that will put all the keys into a buffer or immediately convert it to an integer so that the result can be returned to the function that called it.
how do u presume i'm a hacker :(
people who try to circumvent the c++ standards and the system are hackers (in my opinion). Follow the rules -- that's what they are for. When someone creates a class with private members he/she has no intention of allowing outsiders to screw around with the data or call private methods. If you do do that then you are on your own and do it at your own risk. Does "undefined behavior" ring any bells?
there is no full-proof method to do what you want. Private members are private for a reason -- to keep hackers like you from accessing them. If you need access then your program should be redesigned. If you are unwilling to do that, then you are just SOL.
>>If we confine our discussion to x86 hardware
claiming a program is portable makes no such restriction, and neither do I.
You are of course correct that 80x88 assembly is portable between os that reside on the 80x88 architechure. But that is not what I implied when I said that assembly is not portable. To be completely portable it would have to run on any archatechure with little more effort than recompiling or reassembling it. That is impossible with assembly. C language, for example, is portable as long as (1) the programmer sticks to ansii C standard functions and (2) there is a c compiler targeted for the platform.
so could you quickly tell me what is HWND?
HWND is a handle to a window that you create. See the tutorial for thorough explaination.
I don't know what your problem is. Do you use spaces or tabs to indent?
None of us would have been born, so we would be nowhere. Which raises an interesting question
Does it feel the same to have never been born as it does to have once lived and now be dead? can_of_worms.open(now);
Steven.
Don't know -- I'll tell you after I'm dead:mrgreen:
My favorite planet -- has to be Earth, because we live here. Without Earth none of us would probably be alive to tell about it..
Really? My copy of Turbo 1 does. When did they remove C++? :rolleyes:
you probably have a Turbo C++ , not Turbo C compiler.:eek:
If u want...:?:
I hav both these programs:cool:
After 1 1/2 years do you think the op really gives a dam?:mrgreen:
The first parameter is the HWND of the function calling MessageBox(). When its NULL it means either the HWND doesn't exist, such as from a console program, or you don't care. If you don't know what a HWND is, then here is a good tutorial intruduction into MS-Windows programming.
10 is not a valid statement. you can write a short program that tests each of your problems.
int main(int argc, char* argv[])
{
int a[5][3] = {0};
int b = 1;
int c = 2;
int d = 3;
a[4][2] *= * b ? c : * d * 2
return 0;
}
:\dvlp\test3\test3.cpp(15) : error C2100: illegal indirection
d:\dvlp\test3\test3.cpp(15) : error C2100: illegal indirection
you can compare times directly. For example
if Time$ < Text1.text
you first have to learn how to interact with a database through VB. The DB could be as simple as a text file or very complex such as MS Access or SQL Server.
As for the db code, create a menu on the main form for those three options you posted. Options 1 and 2 can be combined because you can only create a new user by adding a new password. As for option 4 -- edit user name -- that is normally not allowed because the user name is a unique key field in the database. To edit user name you normally have to delete the current user and recreate it with the new name as a new user.
your coding style leaves a lot to be desired. Do you really code your program with everything left justified on the page as you posted it? I wanted to edit your post to add code tags but that would not have helped. Not very many (if any) people will even read your program when it looks like that.
you have a couple options: (1) put each of the strings in an array of strings, or (2) keep a linked list of the lines that are read.
Here is an example of using the array.
#include <stdio.h>
int main() {
int linecount = 0;
char *array[255] = {0}; // hold 255 lines
char buf[255]; <<HOW MUCH SHOULD WE ALOCATE TE BUFFER?
FILE* fp = fopen("somefile.txt","r");
if( fp == NULL) {
printf("Can't open the file\n");
return 1;
} // read each line of the file
while( fgets(buf,sizeof(buf),1,fp) != NULL) {
// count the lines or do other stuff here
array[linecount] = malloc(strlen(buf)+1);
strcy(array[linecount],buf);
linecount++;
}
// close the file
Did you browse their web site? The quickest way to get answer to your question is to ask mathlib people. Also, here is a tutorial if you need it (I haven't read it).
hai ,
just i am new member. i dn't know the forum rules.we should not answer like this or it had any mistake.please tell me.
forum rules do not prohibit you from giving complete solutions, just discourages it. But you should probably take a few minutes to review the rules anyway.
I think most math operations are performed on the math coprocessor instead of in code. So the functions are probably optimized as much as possible.
First you need to learn SQL query language. There are tutorials on the net as well as books that will teach you. SQL isn't something that you can just pick up in a few minutes. I would suggest you download and install MySql database in your own personal computer so that you can use it to learn and practice SQL without destroying your live database. You need to learn how to create a database, create tables, insert, update and query tables, and learn about joins in the queries.
The first field, ID, is an integer and does not allow null values but you are passing a blank string ''. I think you will probably get runtime errors on that.
most definitely congratulations Narue. Now the fun begins for the next 20 years.
never have that problem -- I learned touch typing in HS and have been touch typing every since (probably about 43 years). I think a lot of young people today learn to type on computer keyboards before they are HS age, and consequently learn typing incorrectly -- hunt-and-peck. Typing should probably be taught in grade school now -- maybe in 4th grade, so that kids will learn correctly.
I wouldn't even consider java for the programs I write -- too damned slow. To me java is only useful in web development and there are probably 10 times more development environments than that. So "use only java" is just not practical or even desireable.
your original post indicated you wanted to move the file to a different driver -- from c:\ to d:\. rename() will not work in that case.
moving files depends on os. I assume your os is MS-Windows, so I would use the win32 api CopyFile() function. Since you want to move the file from one drive to another the file must first be copied then delete the original file. I think CopyFile() will do that for you.
Or, to be more portable, you could use standard FILE or c++ streams to copy the file and delete the original.
I accept PMs only from other mods and admins. There is no reason for others to PM me -- if you have a question just post it in the appropriate board for anyone to answer.
I have never heard of hogmanay, so looked it up on google. OMG! It appears to be a 4-day celebration!
we also have no snow -- and it pleases me to no end! I hate the stuff, shoveling it off the roads and driveways is a lot of work. If I want to see snow I'll drive into the mountains (which I have not done in the past 25 years). The only places where show should be allowed is in sky resort areas where people enjoy breaking arms and legs, and getting buried alive in snow avalanches.
I would suggest getting input as a string so that you can detect invalid characters. scanf() won't necessarily do that for you. For example you might type "123.45abcd" and scanf() will accept everything up to the first non-numeric character -- 'a' -- without any complaints. But if you want to produce a warning or error to the user then you should get the input as a string (such as call fgets() ) and validate each character.
that is not a circular queue. Circular queues do not have free space anywhere but at the queue's tail. A circular queue uses two pointers -- head points to the byte for the next insertion, and tail points to the byte for the next extraction. when tail+1 == head the queue is full
Like this example
A Definition <of portability>
An application is portable across a class of environments to the degree that the effort required to transport and adapt it to a new environment in the class is less than the effort of redevelopment.
Since it requires a 100% rewrite of assembly language programs to port from one platform (e.g. 80x88) to another (e.g. AIX Unix), assembly language, by definition, is unportable.
what assembler are you using? it can not be assembled with any 32-bit assembler because 16-bit MS-DOS interrupts can not be used in protected mode programs.
also the program is not complete -- it does not terminate back to the os when done but instead keeps executing random instructions that follow the end of your program. If you read some of the other programs posted here you will find some examples of a complete program.
It would definitely be to your advantage to have at least a fundamental knowledge of assembly if for no other reason than to know how programs are run at the machine level. Assembly language is not nearly as relevent in today's 32-bit environments which gobs of ram and fast hard drives. You can still do in-line assembly pretty easily if you think you can out-optimize your compiler. If you are looking for portability between operating systems, such as *nix and MS-Windows, then you should stay clear of assembly -- it ain't portable.
hello!!!
i need a tutorial or source code of any graphical programm (animation is preferred) in c++ using borland turbo c compiler v3. i shall be very thank full to any one who help me in this regard.
thanks!
that compiler does not compile c++ code -- its a C compiler.:rolleyes:
Keep in mind, cin is the C++ version of C's scanf() and must be used appropriately. IMAO that means -- don't! ;)
Don't you mean >> operator is like c's scanf() ? cin by itself is similar to c's stdin file pointer.
I compiled and ran the program -- I didn't get any runtime errors, but I only entered a couple time zones.
Your program is more than a little confusing. why are you putting just one character at a time in its own array element of query[] ? For example, if I enter 123 <Enter> the program puts query[0] = '1', query[1] = '2' and query[2] = '3'. Then if I enter 234 <Enter> the program puts query[3] = '2', query[4] = '3' and query[5] = '4'. At this point it has
query[0] = '1'
query[1] = '2'
query[2] = '3'
query[3] = '2'
query[4] = '3'
query[5] = '4'
Note that the above contain the ascii values for the numbers I entered, not the binary values. The letter '1' is NOT the same as the number 1. (google for "ascii chart" and you will discover why)
Next you extract the three values from the above array. '1', '2' and '3' are the first thee. Then you attempt to use them as the index into the db array. But db array has a maximum of 9 for each dimension, and you are attempting to access '1' (49 decimal).
You have an array overflow problem -- attemtping to access elements out of bounds. To correct this you need to convert the letters to binary. One way to do that is like this:
hundred=filtered[i] - '0';
ten=filtered[i+1] - '0';
one=filtered[i+2] - '0';
…but what about Clisp?
Nothing wrong with it, its just that nobody outside educational instutions use it.