15,300 Posted Topics

Member Avatar for itisgood

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

Member Avatar for itisgood
0
105
Member Avatar for intills

>> input[0] = toupper(input[0]); And what will happen if the first character is white space? [code] #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 …

Member Avatar for mrnutty
0
255
Member Avatar for Awah Mohamed

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 …

Member Avatar for mrnutty
0
88
Member Avatar for Green Anorak

1. never ever use gets() -- it can destroy your program at runtime if you enter more characters than the input buffer can hold. Use fgets() instead to limit input. The downside to that function is you have to remove the trailing '\n' charcter (the <Enter> key) 2. I assume …

Member Avatar for Ancient Dragon
0
85
Member Avatar for hockeygurl35

Use [noparse][code] ... [/code][/noparse] 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 …

Member Avatar for hockeygurl35
0
1K
Member Avatar for hg_fs2002

>>void print (first1); Just like arguments to any other function you have to tell it what kind of objectg first1 is -- such as [icode]void print (Gnode* first1);[/icode]

Member Avatar for hg_fs2002
0
1K
Member Avatar for cmutzel02
Member Avatar for cmutzel02
0
271
Member Avatar for redeorhcsIT
Member Avatar for Ancient Dragon
-1
60
Member Avatar for Iron_Cross

The c++ compiler/IDE in the article is no longer recommended -- Dev-C++ too old and obsolete. Either of the following free compilers/IDEs are now recommended [URL="http://www.codeblocks.org/downloads"]Code::Blocks with MinGW compile[/URL] [URL="http://www.microsoft.com/express/Downloads/"]VC++ 2010 Expess[/URL] [URL="http://www.winprog.org/tutorial/"]Here is a tutorial[/URL] for introduction into MS-Windows GUI programming using pure win32 api functions.

Member Avatar for Ancient Dragon
11
1K
Member Avatar for Danny_501

"a" is a pointer to the letter 'a', it is not c++ class std::string. You can only use the + operator on std::string [code] std::string a = "a"; std::string b = "b"; std::string c = "c"; std::string text = a+b+c; [/code]

Member Avatar for Danny_501
0
112
Member Avatar for cyqrus

>>As s thing that its better to not use any database just bec of the person who will gonna use it ,maybe he dont have install sql or something in his/her computer that way the use just file. You could use SqLite, which is completely embedded in your program and …

Member Avatar for cyqrus
0
184
Member Avatar for anjoz

Replace cout with printf() Replace cin with scanf() Replace ofstream and ifstream with FILE* Replace [icode]fin >> [/icode] with fread() or possibly fgets(), depending on what is being read. Replace [icode]fout << [/icode] with fwrite(), or possibly fprintf(), depending on what is being written.

Member Avatar for Ancient Dragon
0
101
Member Avatar for Awah Mohamed

>>i have c compiler so can i use it or i need c++ compiler and where can i get it Depends on the C compiler you are using. Most modern compilers will compile both C and C++, depending on the file exten. *.c is normally compiled as C code while …

Member Avatar for Ancient Dragon
0
232
Member Avatar for hg_fs2002

getline() does not add the new line character to the end of the string, so if you display the string don't add endl or '\n' after it.

Member Avatar for Ancient Dragon
0
94
Member Avatar for enkidu75

A solution is actually even simpler than what David suggested above. But I think the OP's instructor wants him to use that c++ class he posted. He will have to use an array, or vector, of those class objects. IMO that's really a dumb way to solve the problem, but …

Member Avatar for Ancient Dragon
0
342
Member Avatar for vmanes
Member Avatar for VBNick

>>I just need to find a computer somewhere that I know hasn't already had the vc++ redistributable installed on it already That should be quite easy -- just do a fresh install of the Windows operating system.

Member Avatar for VBNick
0
291
Member Avatar for The Founder

An example of a fake signature is what the mods snipped from your post. It consists of one or more links. Click the CONTROL PANEL link found at the top of evey DaniWeb page. On the left side of that page you will see a list of links, one of …

Member Avatar for Ancient Dragon
-2
79
Member Avatar for Lukezzz

Here is an example of how to copy all the subfolders and files to a new destination folder. Looks like you are using managed code, so I don't know how to use unmanaged win32 functions in managed programs. [code=cplusplus] #include <windows.h> #include <iostream> using namespace std; int main() { SHFILEOPSTRUCT …

Member Avatar for JuliaSh
0
4K
Member Avatar for Danksalot

Repost your question [URL="http://forums.macrumors.com/forumdisplay.php?f=73"]here [/URL]-- it is specifically for mac

Member Avatar for Danksalot
0
929
Member Avatar for Lusiphur
Member Avatar for Lusiphur
0
250
Member Avatar for Marembo

don't know, unless its because you missed a \ in line 1 just before My Documents. VC++ 6.0 is a very very old compiler that may, or may not support that import statement.

Member Avatar for Marembo
0
216
Member Avatar for anu07

You can hide the console window if you want to. In MS-Windows you have to use win32 api functions to do it. [code] #include <windows.h> int main() { HWND hWnd = GetConsoleWindow(); ShowWindow(hWnd,SW_HIDE); } [/code]

Member Avatar for anu07
0
67
Member Avatar for alan4545
Member Avatar for VBNick

if you are using read() to read the data, then immediately call gcount() to get the number of bytes that were read. tellg() will only tell you where the file pointer is, not how many bytes were read.

Member Avatar for VBNick
0
252
Member Avatar for shankarz

>>How this while is executed? Its an infinite loop because fgets() never returns EOF. fgets() returns NULL when it reaches end-of-file

Member Avatar for Ancient Dragon
0
82
Member Avatar for Joe Shmoe

>> I'd like to use char arrays for this, not c strings if possible. They are the same thing in C language. If you want to keep all the tokens (or words) in memory for all lines of the file then just generate a linked list of them. [code] struct …

Member Avatar for Ancient Dragon
0
128
Member Avatar for Dani

>>If you cannot log in, please email me at [email]cscgal@daniwebmail.com[/email] ... Thanks!!!!! That's a bit like the message "keyboard undetected -- press any key to continue" :)

Member Avatar for Lusiphur
0
454
Member Avatar for vlad44

line 23: sizeof(& file_F)); That is returning the size of a pointer, not the structure. Remove the & address operator.

Member Avatar for vlad44
0
148
Member Avatar for neotaunter

With a MS-Windows 32-bit (or 64-bit) compiler you will have to use the console functions in windows.h to get and set the current cursor position. Something like this: [code] #include <Windows.h> #include <stdio.h> void gotoxy(int x, int y) { // set the current cursor position COORD coord; coord.X = x; …

Member Avatar for Ancient Dragon
0
3K
Member Avatar for bbman
Member Avatar for Sandeep929

Although that may have answered your question, I hope you realize that article is 8 years old and we now have Windows 7. I think w2K was the first Microsoft operating system whose hard drive didn't crash often. I don't think I've had a problem with NTFS since then (knock …

Member Avatar for Ancient Dragon
0
80
Member Avatar for wiegmale

I used VC++ 2010 Express and did not get that link error. All I added was this to the bottom of what you posted (after the #endif) [code] int main() { ArrayList<int> a; } [/code]

Member Avatar for mitrmkar
0
158
Member Avatar for idb_study

>>void main() main should never be declared like that. The only acceptable way to declare it is [icode]int main()[/icode] or [icode]int main(int argc, char* argv[]);[/icode] what is [b]userinput[/b]? It has not been defined. Your compiler should have produced an error on that line. If you ignored the error than shame …

Member Avatar for mitrmkar
0
305
Member Avatar for LevyDee

>>what are DLL's Libraries of functions that are shared among all processes and threads which greatly reduces the amount of memory that program consume. If it were not for DLLs every program on your computer would be at least tripple its current size. >>what exactly is a kernal The operating …

Member Avatar for Ancient Dragon
0
207
Member Avatar for khiawyen

If your project contains lots of *.c and/or *.cpp files with lots of includes that are common among all of them then using precompiled headers will help speed up the compile process. How to do that, if it can be done at all, will depend on the compiler you are …

Member Avatar for Ancient Dragon
0
220
Member Avatar for shankarz

The compiler will generate a pointer to the first character of a character array if all you pass is the array name, The & symbol is optional. If you want a pointer somewhere else in the array then you have to use the & operator and tell it which byte …

Member Avatar for kings_mitra
0
105
Member Avatar for Buffalo101

First of all you will need to use a database to save all that appointment stuff. The database can be as simple as a text file or as complex as an SQL compliant database such as Microsoft Access, SQL Server, Oracle, Sybase, etc (there are quite a few of them). …

Member Avatar for LevyDee
0
102
Member Avatar for farah up

According [URL="http://www.liutilities.com/products/winbackup/filextlibrary/files/STF/"]to this [/URL] [quote] The .STF file extension identifies a Setup Information file which relates to Microsoft's Setup procedures and may contain tabular index information for use by this function.[/quote] You probably need some sort of Microsoft Installer program to generate that file.

Member Avatar for Ancient Dragon
0
45
Member Avatar for mukund_yk

I think you would have more success by reading the entire line with fgets() then just write the line into the output file starting with the 3d byte of the input buffer [code] char inbuf[255]; while( fgets(inbuf, sizeof(inbuf), Numbered) != NULL) { fputs(&inbuf[2], Filtered); } [/code]

Member Avatar for Ancient Dragon
0
98
Member Avatar for empror9

why do those two functions have arguments? Did your instructor tell you to do that? Move lines 4 and 5 down into main() before calling either of those two functions, delete lines 11 and 12, then you can use the same variables for both functions on lines 32 and 34. …

Member Avatar for empror9
0
133
Member Avatar for heinzw

>>close(mfdprot); You probably meant fclose(mfdprot) Sounds like your operating system is buffering up the data. Try adding fflush() before fclose().

Member Avatar for heinzw
0
288
Member Avatar for jmangu

32-bit compilers such as Dev-C++ do not support any of the functions in dos.h. Those functions won't work on MS-Windows operating system since Win98 (10-20 years ago).

Member Avatar for Ancient Dragon
0
443
Member Avatar for Member 784689

MessageBox.Show() has several overloaded functions. [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox.show.aspx"]Read the list here [/URL]and you will see how to do that. As for books -- search amazon.com and you will find them.

Member Avatar for Ancient Dragon
0
168
Member Avatar for Rocky111

Look carefully at those while loops. See anything strange (wrong) with them? Take the first set of while loops. The first thing that will happen is that inFile6 will read the entire file while inFile3 and inFile4 remain constant (they won't read any more. After inFile6 reaches end-of-file the inFile6 …

Member Avatar for Ancient Dragon
0
150
Member Avatar for Member 784361

Opening an image file in C language is no different than opening any other file. Its what you want to do with it after that which can get tricky. Either your instructor is very very stupid or just didn't want to be bothered with your question. And yes, you can …

Member Avatar for Ancient Dragon
0
152
Member Avatar for cwarn23

>>However, we allow the [color] bbcode to be used within code tags that are not syntax highlighted to point out specific items. only [noparse][color=red][/noparse] works. Other colors are ignored.

Member Avatar for TrustyTony
0
117
Member Avatar for rayborn66

Actually, the loops in both code snippets are wrong. Why? Because eof() doesn't work like that. It only detects eof-of-file AFTER an attempt has been made to read the last item in the file, so the last item will get processed twice. A better way to code it is like …

Member Avatar for Kanoisa
0
232
Member Avatar for empror9

#1: [code] int fact = num; for(int i = 2; i < num; i++) fact *= i; [/code]

Member Avatar for Agilemind
0
349
Member Avatar for Francis Waldron

first you need to get the mathametical formulas for those. toupper() and tolower() has nothing to do with that. Once you know that you can start writing the program. Nobody here is going to do that work for you, so post some code and ask all the questions you need …

Member Avatar for Ancient Dragon
0
108

The End.