Search Results

Showing results 1 to 40 of 76
Search took 0.11 seconds.
Search: Posts Made By: Ancient Dragon
Forum: C++ 3 Hours Ago
Replies: 1
Code Snippet: Car racing in turbo C
Views: 37
Posted By Ancient Dragon
What a horrible looking mess. Complete and total lack of any programming style.
Forum: C 16 Hours Ago
Replies: 8
Views: 270
Posted By Ancient Dragon
google (http://lmgtfy.com/?q=lint)
Forum: C 1 Day Ago
Replies: 10
Views: 392
Posted By Ancient Dragon
I created a new C console project with Code::Blocks and it did not produce a warning or error on malloc(), just as I had suspected. Then I created a new C++ console project, changed the file...
Forum: C++ 1 Day Ago
Replies: 6
Views: 162
Posted By Ancient Dragon
Its not possible to delete just the parent -- when you delete the child then parent gets deleted too. Both parent and child form a single object, not two.
Forum: C 1 Day Ago
Replies: 10
Views: 392
Posted By Ancient Dragon
>>invalid conversion from *void to *char
You must be compiling that program as c++, not C (filename has extension *.cpp, not *.c). C does not require typecast, c++ does. Rename your program to...
Forum: C 2 Days Ago
Replies: 10
Views: 392
Posted By Ancient Dragon
line 7: >> char getWord(int wordN) {

All getWord() will return is a single character. What you want it to return is an entire string, so declare it like this: char* getWord(int wordN){


I...
Forum: C++ 2 Days Ago
Replies: 2
Views: 160
Posted By Ancient Dragon
>>Here's a question for you.
Not for me -- I already know how to do that.
Forum: C++ 3 Days Ago
Replies: 3
Views: 168
Posted By Ancient Dragon
use cout

int x = 12345;
cout << x;
Forum: C 4 Days Ago
Replies: 10
Views: 392
Posted By Ancient Dragon
lines 57 and 58: you do not have to initialize the arrays one letter at a time -- just do the entire string at one time

char currentWord[] = "......"; /* The dot word */
char guessWord[] =...
Forum: C++ 4 Days Ago
Replies: 6
Views: 211
Posted By Ancient Dragon
You can erase an element from the map, but you can't delete just one of the pointers because it belongs to an array. If you allocate the pointers one at a time then you could delete them in any...
Forum: Geeks' Lounge 4 Days Ago
Replies: 4
Views: 222
Posted By Ancient Dragon
That is Wal-Mart this year -- no Christmas music and no Christmas tree at the front doors. Its really sad that Wal-Mart isn't in the Christmas spirit this year.
Forum: Geeks' Lounge 5 Days Ago
Replies: 8
Views: 357
Posted By Ancient Dragon
You need an account on tweeter.com to make that work. It worked for me. BTW I'm Superman :)
Forum: C++ 7 Days Ago
Replies: 5
Views: 267
Posted By Ancient Dragon
What is wrong is that you are using some crappy compiler such as Turbo C to run an MS-Windows 32-bit program. Can't be done. Toss out that compiler and use a modern compiler such as Code::Blocks...
Forum: Geeks' Lounge 7 Days Ago
Replies: 3
Views: 247
Posted By Ancient Dragon
I have no idea what he is trying to say -- just looks like a lot of gobbledegook (http://en.wikipedia.org/wiki/Gobbledygook).
Forum: C 7 Days Ago
Replies: 5
Views: 268
Posted By Ancient Dragon
you forgot the case keyword. Your program contains millions of other errors that you need to correct -- if your compiler doesn't report them then toss out that crappy compiler and get one that...
Forum: C++ 9 Days Ago
Replies: 7
Views: 306
Posted By Ancient Dragon
Here is another way to do it.

string space2underscore(string text)
{
for(int i = 0; i < text.length(); i++)
{
if( isspace(text[i]) )
text[i] = '_';
}
...
Forum: C++ 9 Days Ago
Replies: 7
Views: 251
Posted By Ancient Dragon
What is going on in that code is called undfined behavior and will not work. Why? Because ptr is an uninitialized pointer, and dereferencing it like *ptr = (put anything here) is illegal and will...
Forum: C++ 9 Days Ago
Replies: 1
Views: 190
Posted By Ancient Dragon
create a union

// declare types
enum data_types {
undefined_type = 0,
bool_type,
char_type,
short_type,
ushort_type,
int_type,
Forum: C++ 11 Days Ago
Replies: 9
Views: 455
Posted By Ancient Dragon
you have to declare them extern "C".

#ifdef __cplusplus
extern "C" {
#endif
// C function prototypes here
#ifdef __cplusplus
}
#endif
Forum: DaniWeb Community Feedback 11 Days Ago
Replies: 21
Views: 1,132
Posted By Ancient Dragon
When I come to DW I have the C++ forum bookmarked. So the first thing I do is look at the threads in that forum to see if I need to reply to any of them (via the New button). Then I'd use the...
Forum: DaniWeb Community Feedback 11 Days Ago
Replies: 21
Views: 1,132
Posted By Ancient Dragon
If you need the space, get rid of "Most Recently Viewed Threads" and put back My Favorite Forums.
Forum: C++ 12 Days Ago
Replies: 8
Views: 355
Posted By Ancient Dragon
You have to include wininet.h and shlobj.h, then compile the program for UNICODE
Forum: C++ 13 Days Ago
Replies: 2
Views: 158
Posted By Ancient Dragon
replace all 7 loops with something a function

void GetMartks(std::string prompt, float& mark)
{
cout << prompt << '\n';
cin >> mark;
mark = decimal(mark);
}
Forum: C++ 14 Days Ago
Replies: 2
Views: 334
Posted By Ancient Dragon
There are two ways to add a library to the program

1) #pragma comment(lib, "toolkit.lib"); Put this near the top of any *.cpp file that is in the project.

2) Select menu item Project -->...
Forum: C++ 15 Days Ago
Replies: 7
Views: 238
Posted By Ancient Dragon
>>if(!cookieOrdered.compare(flavors[i]))

You can just simply write this: if( cookieOrdered == flavors[i] ), assuming flavors is an array or vector of strings/character arrays..
...
Forum: C++ 15 Days Ago
Replies: 6
Views: 197
Posted By Ancient Dragon
The value 0.1 can not be represented exactly as a double.
Forum: DaniWeb Community Feedback 15 Days Ago
Replies: 8
Views: 529
Posted By Ancient Dragon
You can always click the "Unanswered Threads" link on the right side of the screen.
Forum: C 15 Days Ago
Replies: 4
Views: 302
Posted By Ancient Dragon
line 23 and 29: You can't add an node that's allocated on the stack to the linked list. Reason: when the function returns the memory address of that node is destroyed and becomes invalid. To fix...
Forum: C++ 16 Days Ago
Replies: 11
Views: 397
Posted By Ancient Dragon
First create an temporary array to hold the values

int array[] = {Q1[0], Q2[0], Q3[0], Q4[0], Q5[0], Q6[0], Q7[0], Q8[0]};
// now for the array
for(int i = 0; i < 7; i++)
{
for(int j = i+1;...
Forum: Geeks' Lounge 17 Days Ago
Replies: 15
Views: 766
Posted By Ancient Dragon
summer -- I hate snow and ice in the winter because it makes driving so hazardous.
Forum: DaniWeb Community Feedback 17 Days Ago
Replies: 44
Views: 2,202
Posted By Ancient Dragon
Of course that doesn't discount the possibility that you are hermaphrodite (both male and female) :)
Forum: C++ 17 Days Ago
Replies: 4
Views: 222
Posted By Ancient Dragon
Create a new project but instead of a console project create a static library, then add the files to it.

Or, if the files are small enough just add them to your console project as if you wrote...
Forum: C++ 17 Days Ago
Replies: 4
Solved: Char* input
Views: 230
Posted By Ancient Dragon
getline() will permit you to enter spaces in the string. If you don't want the spaces then use >> operator cin >> this->name;, but the problem with that is the >> operator will allow you to enter...
Forum: C++ 17 Days Ago
Replies: 4
Views: 218
Posted By Ancient Dragon
turbo c++ is just too old, it won't even run on Windows 7 or Vista on PC. Get Code::Blocks, MinGW, or VC++ 2008 Express.
Forum: C++ 19 Days Ago
Replies: 5
Views: 239
Posted By Ancient Dragon
Yes I could, but give it a try yourself. Its easy to do, just write the loop first and after the loop delete the array. If you wrote that code snippet to allocate the memory then I'm confident you...
Forum: C++ 20 Days Ago
Replies: 7
Views: 277
Posted By Ancient Dragon
The last two arguments have similar problems.
Forum: C++ 20 Days Ago
Replies: 3
Views: 277
Posted By Ancient Dragon
you need to typecast the base class pointer into a derived class pointer before it can call functions unique to the derived class. Base class knows nothing about those functions.
derived_class...
Forum: Geeks' Lounge 20 Days Ago
Replies: 17
Views: 1,170
Posted By Ancient Dragon
Already got my Christmas present this year -- Samsung 55" 400+ Hz LED TV, Blue-Ray DVD player, and Bose speakers.
Forum: C++ 21 Days Ago
Replies: 2
Views: 237
Posted By Ancient Dragon
Here is one way to do it -- use stringstream class

#include <sstream>
#include <string>
#include <iostream>
#include <iomanip>
using namespace std;

int main(int argc, char* argv[])
{
Forum: C++ 25 Days Ago
Replies: 2
Views: 192
Posted By Ancient Dragon
string resides in std namespace and you have to tell the compiler what namespace it's in. You have several options (use only one of the options listed below)

using namespace std; put that after...
Showing results 1 to 40 of 76

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC