Forum: C++ 2 Hours Ago |
| Replies: 2 Views: 41 simple colution
int main()
{
int num;
char chars[] = "abcdefghijklmnopqrstuvwxyz";
cout << "How many strings do you want to create?\n";
cin >> num;
long n = 0;
... |
Forum: C++ 2 Hours Ago |
| Replies: 2 Views: 29 On my computer Alt+2 generages '☻', not ^B |
Forum: C++ 2 Hours Ago |
| Replies: 1 Views: 34 It should exchange the value of the two variable parameters. The two parameters are passed by reference (http://www.brpreiss.com/books/opus4/html/page593.html) so that swap() can change them and the... |
Forum: C 11 Hours Ago |
| Replies: 1 Views: 59 >>is it a standard one?
Yes -- all compilers are required to implement it like that. Here (http://en.wikipedia.org/wiki/ANSI_C) is info about ansi c standards
>>the array name cannot be changed... |
Forum: C++ 21 Hours Ago |
| Replies: 5 Views: 95 You can solve for pc first in a similar manner that I posted. I think the problem in ComputerMove() is that if a square is already eith 'x' or 'o' you need to generate another random number and try... |
Forum: C++ 21 Hours Ago |
| Replies: 5 Views: 171 It doesn't make a lick of sense to write a custom print function for every conceivable data type using printf() or fprintf(). cout, ofstream and ifstream already have overloaded functions that do it... |
Forum: C++ 22 Hours Ago |
| Replies: 5 Views: 95 This minor change made it work when I move first
if (choice==1) //if player wishes to go first
{
bool done = false;
do{
... |
Forum: C 23 Hours Ago |
| Replies: 10 Views: 195 Oh I see -- I guess I misunderstood. You would have to sort the list after it was finished. When sorting linked lists just exchange the actual data, not the entire nodes, to preserve the link... |
Forum: C 23 Hours Ago |
| Replies: 3 Views: 101 If all you want to do is run that program once when what' the point of making the text file into a fixed-length records? Such a scheme would limit the usefullness of your program. |
Forum: C 23 Hours Ago |
| Replies: 2 Views: 106 where is your code? No one here will write that program for you. |
Forum: Geeks' Lounge 1 Day Ago |
| Replies: 7 Views: 123 Not really my "favorite", but Wanted is a very very good action movie. If you liked Die Hard you will also like Wanted.
I suppose my favorite was Dune. I wore out two tapes because I watched it... |
Forum: C++ 1 Day Ago |
| Replies: 2 Views: 92 what compiler are you using? I compiled/ran with vc++ 2008 express and your first program worked ok. |
Forum: C 1 Day Ago |
| Replies: 10 Views: 195 Change AddWord() to add the new node in ascending or descending order. Then you won't have to bother about sorting later. |
Forum: C 1 Day Ago |
| Replies: 5 Views: 160 1) remove conio.h -- its non'standard and not implemented by very many compilers. Code snippets should not use compiler-specific stuff.
2) delete all those global variables on lines 12 and 13. ... |
Forum: C++ 1 Day Ago |
| Replies: 2 Views: 91 >>mysql_result[3000][2]=msq_row;
If you programmed the rest of that then you should probably know that the above like doesn't work. You should be reading this tutorial... |
Forum: C++ 1 Day Ago |
| Replies: 14 Views: 285 Why didn't you just convert flavor to lower case instead of creating yet another variable? |
Forum: Geeks' Lounge 1 Day Ago |
| Replies: 19 Views: 317 I suppose that means playing a game is more important than doing homework. |
Forum: C++ 1 Day Ago |
| Replies: 4 Views: 171 >>The changes you mentioned have been made except for changing ! == to !=. For some reason, my compiler is not liking !=. I get the error "ISO C++ forbids comparison between pointer & integer". I'm... |
Forum: C++ 1 Day Ago |
| Replies: 11 Views: 191 could be re-written like this: Notice you don't need || at all. And that function should only have a return statement at the end of the function, not on every line.
char grade;
... |
Forum: C 1 Day Ago |
| Replies: 3 Views: 101 You don't have to store all the lines, just the two lines that you want to compare. Sequentially read the file, counting lines as you go along then save only the two lines you want to compare. |
Forum: C++ 1 Day Ago |
| Replies: 4 Views: 171 line 7 and 8 of the read function: Line 8 is unnecessary because line 7 opens the file when the stream is declared.
line 12: if lastname never contains spaces then use use >> operator instead... |
Forum: C++ 1 Day Ago |
| Replies: 4 Views: 114 c++ has std::string that is declared in <string> header file. google for std::string and you will find links that describe all its methods. |
Forum: C++ 1 Day Ago |
| Replies: 4 Views: 114 There are two problems on each of those lines
1) one, two, three, etc are not defined in that function.
2) char is a data type, but you failed to provide a variable name. For example char... |
Forum: C++ 1 Day Ago |
| Replies: 6 Views: 136 void swap(int* int1, int* int2)
{
int temp = *int1;
*int2 = *int1;
*int1 = temp;
}
void sort(int int1, int int2, int int3)
{ |
Forum: C++ 1 Day Ago |
| Replies: 4 Views: 163 Deposit $10,000.00 USD in my paypal account and I'll do it for you. Otherwise you will just have to write the program yourself. |
Forum: C++ 2 Days Ago |
| Replies: 1 Views: 97 >>The program was initially written in VC++
VC++ is not a computer language. Its an IDE/compiler. So saying you are converting from vc++ to c++ is nonsense. |
Forum: C++ 2 Days Ago |
| Replies: 5 Views: 171 better off replacing that fprintf() with c++ fstream class so that the compiler won't complain so much. |
Forum: C++ 2 Days Ago |
| Replies: 3 Views: 92 If you use string, then use find() to locate the space, and substr() to extract the characters from position 0 to the location returned by find(). |
Forum: C 2 Days Ago |
| Replies: 10 Views: 195 delete line 56 -- it does nothing. |
Forum: C 2 Days Ago |
| Replies: 10 Views: 195 Why did you use fgets() instead of fscanf()? fgets() gets the entire line without regard to spaces, which is not what you want. Look at the simple code I posted, it does what you need. All you... |
Forum: C++ 2 Days Ago |
| Replies: 6 Views: 136 Its a lot easier to sort them if you use an array of 3 integers instead of 3 individual variables.
int arry[3] = {0};
for(int i = 0; i < 3; i++)
{
cout << "Enter an integer\n";
cin >>... |
Forum: C++ 2 Days Ago |
| Replies: 11 Views: 191 You now have all the pieces you need, all you need to do now is put them together. In your original program, just delete lines 19-45 because they are not necessary. Then just write a simple for... |
Forum: C 2 Days Ago |
| Replies: 11 Views: 210 Yes. Its not really all that big a deal since the program has reserved space for the data anyway. Even though you have the arrays declared in if statements the compiler will allocate memory for all... |
Forum: C++ 2 Days Ago |
| Replies: 1 Views: 104 Yet Another Compiler Compiler (YACC) (http://dinosaur.compilertools.net/yacc/index.html) |
Forum: C++ 2 Days Ago |
| Replies: 3 Views: 134 Is a core file produced? Yes, then use dbg on that core file and it will tell you where the crash occurred. |
Forum: DaniWeb Community Feedback 2 Days Ago |
| Replies: 0 Views: 99 When I hit the Edit button to edit a post there is another active Edit button. Can you remove that button because its confusing. |
Forum: C 2 Days Ago |
| Replies: 10 Views: 195 >>The program is supposed to take in a file provided through standard input
That means get the name of the file from standard input, not the lines of the file. You have to open the file and read... |
Forum: C 2 Days Ago |
| Replies: 1 Views: 135 Modern 32-bit compilers to not support that header file because it was intended for 16-bit MS-DOS 6.X and earlier operating systems. The alternative is to use win32 api functions OpenFile() to open... |
Forum: C 2 Days Ago |
| Replies: 11 Views: 210 Yes it does work.
Read the file into the array just like it was any other normal text file. |
Forum: C 2 Days Ago |
| Replies: 11 Views: 210 >>Is there anyway to achieve this?
No because the #inc lude directive is processed at compile time, not runtime. |