Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Showing results 1 to 40 of 500
Search took 0.23 seconds.
Search: Posts Made By: Ancient Dragon
Forum: C++ Yesterday, 10:00 AM
Replies: 4
Views: 84
Posted By Ancient Dragon
Re: Help with plural Prggram

What do you need help with? We are not mind readers to you will have to tell us.
Forum: C++ Yesterday, 12:43 AM
Replies: 11
Views: 123
Posted By Ancient Dragon
Re: Reading a file?

After thinking about it I believe you are right. Variable first is not used as an index as it is in an array but as the value that was inserted into the map. Using negative values in a map is...
Forum: C++ Mar 11th, 2010, 11:37 PM
Replies: 11
Views: 123
Posted By Ancient Dragon
Re: Reading a file?

Your code will not do that either.



Try replacing variable first with -1 and you will see why.
Forum: C Mar 11th, 2010, 5:41 PM
Replies: 5
Views: 256
Posted By Ancient Dragon
Re: Why there is a segmentation fault ?

You apparently wrote your program as a c++ program, not a C program. C programs have *.c extension. Change the file's extension to *.c and it will compile without the typecast.
Forum: Coder's Corner Lounge Mar 11th, 2010, 11:15 AM
Replies: 1
Views: 45
Posted By Ancient Dragon
Re: In need some help in programming

Do your own homework.
Forum: C Mar 11th, 2010, 11:10 AM
Replies: 5
Views: 97
Posted By Ancient Dragon
Re: Stuck in makng a simple factorial program.

>> else return n * factorial(n-1);

The else is not needed.
Forum: C++ Mar 11th, 2010, 11:04 AM
Replies: 11
Views: 123
Posted By Ancient Dragon
Re: Reading a file?

A slightly shorter way is like this, which will work as long as first is never negative and has no duplicates in the file.

int read_file(char * filename)
{
ifstream in(file_name);
if(...
Forum: C++ Mar 11th, 2010, 12:01 AM
Replies: 5
Views: 56
Posted By Ancient Dragon
Re: function that reads an ascii char string and returns the int value

tens = tens * 10; //step up an order of magnitude

charToInt = c - '0';

tot += (charToInt * (tens));


The above code is incorrect. It can be put on a single line like this: tot = (tot*10) + c -...
Forum: C++ Mar 10th, 2010, 11:42 AM
Replies: 5
Views: 56
Posted By Ancient Dragon
Re: function that reads an ascii char string and returns the int value

loop through the string one character at a time, check the character if it is a digit 0-9. If it is then convert from digit to binary. For example, if the digit is '1' then you can convert it to...
Forum: C Mar 10th, 2010, 10:59 AM
Replies: 2
Views: 74
Posted By Ancient Dragon
Re: Font Size

read this thread (http://cboard.cprogramming.com/windows-programming/102187-console-font-size.html)
Forum: Community Introductions Mar 9th, 2010, 10:07 PM
Replies: 2
Views: 164
Posted By Ancient Dragon
Re: New Website Owner

Welcome and thanks for reading the Rules.
Forum: C++ Mar 4th, 2010, 12:30 PM
Replies: 3
Views: 83
Posted By Ancient Dragon
Re: assembler language

yes of course all c++ compilers do. Examle inline assembly for Microsoft compilers

int main()
{
int something;
_asm
{
mov [something],0
}
}
Forum: C++ Mar 4th, 2010, 9:46 AM
Replies: 3
Views: 83
Posted By Ancient Dragon
Re: assembler language

I don't know if you can or not. Do you know assembler language?
Forum: C Mar 3rd, 2010, 7:58 PM
Replies: 6
Views: 91
Posted By Ancient Dragon
Re: A problem with a program that uses multiple source files

you are not supposed to put executable code in header files. Move the two functions in utils.h into one of the two olther *.c files or create a utils.c file and put them there. Leave the function...
Forum: C++ Mar 2nd, 2010, 5:18 PM
Replies: 3
Views: 112
Posted By Ancient Dragon
Re: check it plz

factorials become very large numbers very quickly, and int data type has only limited capacity, see limits.h for the maximum value that is possible for your compiler. You might want to use a 64-bit...
Forum: Assembly Mar 2nd, 2010, 5:09 PM
Replies: 2
Views: 153
Posted By Ancient Dragon
Re: x86 Pentium NASM lowercase to uppercase

Note that process_char is mostly coded wrong. In order to use the loop instruction you first have to set ecx (or cx) to the number of times the program needs to loop, such as the length of the...
Forum: C Feb 28th, 2010, 11:48 AM
Replies: 6
Views: 290
Posted By Ancient Dragon
Re: problem about dialog based win32 application

See the default case below.

LRESULT CALLBACK MyDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_INITDIALOG:
MessageBox(NULL, "Hello", "hello", MB_OK);
return...
Forum: C++ Feb 28th, 2010, 11:12 AM
Replies: 16
Views: 311
Posted By Ancient Dragon
Re: morse code

In order to get the timings you have to resort to operating system specific API functions. For example on MS-Windows you could use clock() or maybe Query PerformanceFrequency()...
Forum: C++ Feb 27th, 2010, 10:31 AM
Replies: 6
Views: 158
Posted By Ancient Dragon
Forum: C Feb 27th, 2010, 9:18 AM
Replies: 9
Views: 150
Posted By Ancient Dragon
Re: Parameters in main()

use Code::Blocks or VC++ 2008 Express, both are free and compile both C and C++ programs. Just google for them and you will find the download links.
Forum: C Feb 27th, 2010, 9:12 AM
Replies: 11
Views: 221
Posted By Ancient Dragon
Re: Problem with GNU GCC Compiler

lines 80, 85, 90, and 91. You can't stuff two characters into a char variable. '\b ' is two characters, not one.

After correcting the above, I get this output (vc++ 2008 express...
Forum: C++ Feb 26th, 2010, 11:51 PM
Replies: 16
Views: 311
Posted By Ancient Dragon
Re: morse code

>>because i dont know how to start

Start here


int main()
{
// put your code here
}
Forum: C Feb 26th, 2010, 12:44 PM
Replies: 9
Views: 150
Posted By Ancient Dragon
Re: Parameters in main()

Surprise! You are using a very ancient compiler that may or may not work with modern operating systems. Download free version of Code::Blocks with MinGW compiler, or free VC++ 2008 Express and that...
Forum: C Feb 25th, 2010, 11:56 PM
Replies: 9
Views: 150
Posted By Ancient Dragon
Re: Parameters in main()

what compiler are you using?
Forum: Other Programming Languages Feb 25th, 2010, 11:35 AM
Replies: 5
Views: 125
Posted By Ancient Dragon
Re: Help with Fortran

That is correct.
Forum: C Feb 25th, 2010, 11:24 AM
Replies: 9
Views: 150
Posted By Ancient Dragon
Re: Parameters in main()

All c compilers add some code to the beginning of the program that do some processing before main() is called. One of the jobs of that startup code is to create an array of strings that were the...
Forum: C Feb 25th, 2010, 11:18 AM
Replies: 2
Views: 101
Posted By Ancient Dragon
Re: Nth root program error

yor function sqrt() conflicts with the function sqrt() found in math.h. Name your function something else.
Forum: Python Feb 25th, 2010, 7:55 AM
Replies: 5
Views: 7,710
Posted By Ancient Dragon
Re: Does this qualify as a shredding algorithm?

Too much spam posts in this thread so I'm closing it. If you want to continue the discussion then start another thread.
Forum: C++ Feb 24th, 2010, 1:08 AM
Replies: 11
Views: 184
Posted By Ancient Dragon
Re: A while loop for a program

Because I will issue warnings, infractions, and even possibly bans without them.
Forum: Assembly Feb 23rd, 2010, 11:57 PM
Replies: 4
Views: 88
Posted By Ancient Dragon
Re: Funny Question!

I wasn't talking about a huge program. Just write a tiny program with the instructions you want and see how they are assembled.
Forum: C++ Feb 23rd, 2010, 11:34 PM
Replies: 11
Views: 184
Posted By Ancient Dragon
Re: A while loop for a program

I guess you didn't try this???

while( salesmanNumber != -999)
{
// blabla
}
Forum: Community Introductions Feb 23rd, 2010, 4:04 PM
Replies: 8
Views: 267
Posted By Ancient Dragon
Re: Justin

It may not be a negative, but certainly not a valuable positive. It only helps if two candidates have equal experience but one has certifications and the other does not. Otherwise experience will...
Forum: Assembly Feb 23rd, 2010, 2:30 PM
Replies: 4
Views: 88
Posted By Ancient Dragon
Re: Funny Question!

I don't know the answer, but you can easily find out by running an assembler such as masm and see what it produces.
Forum: Coder's Corner Lounge Feb 22nd, 2010, 11:26 PM
Replies: 1
Views: 91
Posted By Ancient Dragon
Re: ADL and SQL

SQL is still quite relevant although its not a programming language.

COBRA is not a programming language but a library of functions that allow programs to do distributed processing (transfer data...
Forum: Community Announcements and Feedback Feb 22nd, 2010, 7:50 PM
Replies: 31
Views: 2,232
Posted By Ancient Dragon
Re: daniweb vs programmingforums?

Not so. Its called libel, not slander. Slander is for spoken words. Libel is written words. http://en.wikipedia.org/wiki/Defamation
Forum: C# Feb 22nd, 2010, 1:02 PM
Replies: 2
Views: 101
Posted By Ancient Dragon
Re: Take 'Backup' of SQL Server Compact database

You might want to copy the database to a PC just in case the file system on the embedded device becomes corrupt or is erased (sometimes cold booting it will erase most of the file system).
Forum: C Feb 22nd, 2010, 9:07 AM
Replies: 7
Views: 118
Posted By Ancient Dragon
Re: showing a leading 0 on the minutes in C Time

You are stil doing it the hard way. And in case you forgot, this is C forum, not C++.
cout << setfill('0') << setw(2) << t.wMinute;
Forum: Community Introductions Feb 22nd, 2010, 8:36 AM
Replies: 21
Views: 901
Posted By Ancient Dragon
Re: Which language would you say to start?

If you want to make programming a career then you will have to learn several languages including, but not limited to, C, C++, Java, C++/CLR, C#, Python, HTML (and other related web scripting). Talk...
Forum: C Feb 22nd, 2010, 8:31 AM
Replies: 7
Views: 118
Posted By Ancient Dragon
Re: showing a leading 0 on the minutes in C Time

OMG didn't you ever read about the printf() format string???? :icon_twisted: All you have to do is this: printf("%02d", t.wMinute); **sign**
Forum: Assembly Feb 21st, 2010, 7:38 PM
Replies: 2
Views: 87
Posted By Ancient Dragon
Re: assembled in vc++ but could not assmble with masm32

The error messages say it all -- it doesn't know where those two functions have been coded.
Showing results 1 to 40 of 500

 
Forum Jump



DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:52 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC