15,300 Posted Topics

Member Avatar for catums14

>> if (argv[2] = "SC") You can't compare character arrays using the = operator like you do VB. Use strcmp() function prototyped in string.h header file -- or <cstring> if you prefer. [icode]if( strcmp(argv[2], "SC") == 0)[/icode]

Member Avatar for catums14
0
159
Member Avatar for krishnampkkm

This opens the directory, gets the directory size ok, but fails to read the directory. I don't know what can be done with the handle. [code] #include <windows.h> #include <iostream> #include <fstream> using namespace std; int main() { HANDLE hFile = CreateFile("C:\\users", GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); if( hFile …

Member Avatar for krishnampkkm
0
4K
Member Avatar for nakemaro

Its an infinite loop because the value of y never changes. >> x=static_cast<int> (y)%10; The cast is unnecessary because y is already an int, and y%10 is also an int. And why is d_a a double? Why not just enter the binary digits as an integer? (unless of course that …

Member Avatar for Ancient Dragon
1
122
Member Avatar for mattyd
Member Avatar for vegaseat
1
244
Member Avatar for rebirth007

The password can not be verified, probably its just a fake username and password in the code your posted. You need to provide a valid user name and password -- but do NOT post them here.

Member Avatar for Ancient Dragon
0
420
Member Avatar for sudiptamondal

After entering an integer you have to flush the '\n' <Enter key> from the keyboard buffer. The easiest way to do that is [icode]cin.ignore(1000,'\n');[/icode]. Read [URL="http://www.daniweb.com/forums/thread90228.html"]this thread[/URL] for more details.

Member Avatar for sudiptamondal
0
101
Member Avatar for stark025

[code] static const char * sql_backslash_to_underscore(const char * key) { if (!key) { ERROR0("got NULL key"); return NULL; } char * dup = strdup(key); char* ptr; while( (ptr = strrchr(dup,'\')) != NULL) *ptr = '_'; return dup; } [/code] One problem with the above code is that the caller cannot …

Member Avatar for Ancient Dragon
0
194
Member Avatar for Birendra Dhami

[QUOTE=Birendra Dhami;889470]sir how can i add two fraction nos. to get again fraction eg. a/b+c/d=(ad+bc)/bd I would be very happy if u send me code.[/QUOTE] We are not in the business of doing homework free of charge. Add $1,000.00 USD to my pay pal account and I'll do it for …

Member Avatar for csurfer
0
110
Member Avatar for meb111

Never tried it myself, but maybe [URL="http://www.dreamincode.net/forums/showtopic35141.htm"]this thread [/URL]will help you. It contains some source code to call the GetPixel() function.

Member Avatar for meb111
0
79
Member Avatar for themaster

why don't you just use one of the platform independent GUI 3d party libraries, such as [URL="http://www.wxwidgets.org/"]wxWindows[/URL], [URL="http://www.gtk.org/download.html"]GTK+[/URL], or [URL="http://www.qtsoftware.com/products/"]QT[/URL]. I think wxWindows and GTK+ will both work with VC++ 2008 Express (although I have not tried it). QT is its own IDE which works with nearly any 32-bit compiler.

Member Avatar for Ancient Dragon
0
293
Member Avatar for seemant_sun

[QUOTE=jephthah;888540] fgets will return [I]everything[/I] up to and including the newline. But the problem is, that a newline character's ASCII representation is system dependent. [/QUOTE] Not in memory -- its always '\n' regardless of the operating system. Its just the file systems on physical hard drives that are different from …

Member Avatar for seemant_sun
0
484
Member Avatar for Usura

>>while (in >> str) out << str << "-"; What??? That will not replace white spaces with '-' character. [code] while( in >> str) { for(int i = 0; i < str.length(); i++) { if( isspace(str[i]) ) str[i] = '_'; } out << str << "\n"; } [/code]

Member Avatar for Ancient Dragon
0
791
Member Avatar for jimb90

I don't drink coffee -- no option for that either, so I stopped at the first question.

Member Avatar for Tulsa
0
316
Member Avatar for seemant_sun

Those C functions may not work with huge files -- files that are larger than 2 gig. In MS-Windows win32 api functions would be needed to get the file size of huge files. I don't know about *nix or MAC

Member Avatar for Ancient Dragon
0
120
Member Avatar for seemant_sun
Member Avatar for Ancient Dragon
0
137
Member Avatar for scott123456

Welcome to Daniweb. Please post your question in the appropriate forum. Narue has written a detailed explanation in the C++ board about how to flush the input stream in c++ programs. See the sticky in that forum.

Member Avatar for Ancient Dragon
0
83
Member Avatar for Mijchael

If you want to reference header files in all your projects then select Tools -->Options --> Projects And Solutions --> C++ Directories, then add the paths in the window on the right side of the screen. After that all you have to do is something like [icode]#include <dm/something.h>[/icode] if the …

Member Avatar for Ancient Dragon
0
100
Member Avatar for Salem

[quote]Probably not more than one in a thousand could name more than a couple of the MEPs we sent there last time. [/quote] Its like that here too. Very few American's can name the people in our Congress and Senate. Sure I know the names of a few, but all …

Member Avatar for GrimJack
1
196
Member Avatar for GrimJack

I believe both -- God created everything, how he did it was through evolution.

Member Avatar for GrimJack
0
717
Member Avatar for grandalf62

That operating system and compiler are you using? In my MS-DOS 6.X days I had no conflicts between serial port interrups and printf(). I just wrote a serial port driver (supported 1 to 40 serial ports) that was TSR and the rest of the program ran normally, within the memory …

Member Avatar for grandalf62
0
162
Member Avatar for snyp

So the implementation code for the class is in the application program and not the DLL? Sounds backwards to me, and when compiling the DLL it is not possible for the compiler to resolve the class references. I think you need to redesign something and put the class implementation code …

Member Avatar for Ancient Dragon
0
283
Member Avatar for vandenzergen

>>If you would just give the code I may add up some features Exact code will depend on the operating system. Setting the time/date is quite simple -- just look up the time functions for the operating system.

Member Avatar for Salem
0
1K
Member Avatar for ixuz
Member Avatar for gowth08

Welcome to DaniWeb :) We have quite a few members who are from India, including one of our moderators. Hope you enjoy your stay.

Member Avatar for Rein Valdez
0
59
Member Avatar for MidiMagic
Member Avatar for theashman88

IMHO c++ for dummies is exactly that -- for dummies. There's an entire thread at the top of this forum about c++ books, you should read it. For MS-Windows program all you need is a fundamental knowledge of C or C++ language. The win32 api does not require c++. [URL="http://www.winprog.org/tutorial/"]Here …

Member Avatar for theashman88
0
124
Member Avatar for ithelp

There is no such thing as space that is absolutely empty. space by definition contains something. And in a vacuum there is no space.

Member Avatar for vegaseat
0
143
Member Avatar for colmcy1

>>I do not understand what is happening here Microsoft completely rewrote CString to convert it from a c++ class in VC++ 6.0 compiler to a template in VC++ 2005 and later compilers. There were lots of changes to MFC, and CString was just one of them. Consequently you may have …

Member Avatar for colmcy1
0
799
Member Avatar for Usura

[QUOTE=Usura;886109]could someone please point me to a link on how to convert my char* temp = new char[3]; to a char test[3]?[/QUOTE] Post code. Generally we would not allocate just 3 characters because it isn't worth the effort. But, like everything else, there are exceptions.

Member Avatar for Ancient Dragon
0
69
Member Avatar for shinkelwars

I know of one library, but I don't know if it would fill your needs. [URL="http://www.datareel.com"]DataReel[/URL] This library contains a lot of code, but also client/server sockets with sample programs.

Member Avatar for Ancient Dragon
0
149
Member Avatar for nadith_cs

try putting two colons in front as shown in[URL="http://msdn2.microsoft.com/en-us/library/system.windows.forms.messagebox.aspx"] this example[/URL].

Member Avatar for Nicklorion
0
200
Member Avatar for ogwiz

lines 37-80: That is c++ code, not C. Are you writing a C program (afterall this is the C forum) or a c++ program ?

Member Avatar for ArkM
2
106
Member Avatar for yun

[QUOTE=amrith92;873921]Are you sure that this program compiles? You seem to have used [ICODE]string[/ICODE] in your code, but you haven't included [ICODE]<string.h>[/ICODE] at all...![/quote] That's because std::string is not declared in <string.h> -- its in <string> header file. And some compiler include <string> with <fstream>

Member Avatar for vmanes
0
2K
Member Avatar for yun

how about this: [icode]return (d-1) < 0 ? North : d-1;[/icode] No need for the mod operator.

Member Avatar for Ancient Dragon
0
100
Member Avatar for atman

Moved to C forum because it is a C program, not c++. >>fflush(stdin); Non-standard use of fflush(). There is no standard way to flush the input stream, and fflush() is only defined to flush output streams to the file on disk (e.g. your hard drive).

Member Avatar for Salem
0
158
Member Avatar for connormcleod

Here is one way to do it -- uses a vector of structures instead of individual arrays. [code] #include<iostream> #include <sstream> #include <string> #include <vector> #include <fstream> using namespace std; struct person { string name; float weight; string location; string color; }; //inside main int main(void) { vector<person> people; string …

Member Avatar for kvprajapati
0
9K
Member Avatar for Ancient Dragon

The lady that made an ass of Simon Cowell! What a talented woman :) :) [url]http://www.youtube.com/watch?v=RxPZh4AnWyk&NR=1[/url] I've watched that clip 5 or 6 times and am amazed each time I watch it.

Member Avatar for ahihihi...
0
92
Member Avatar for lukethedrifter

>>memset(wText,0,len); That only sets the first half of the buffer -- what you want is [icode]memset(wText, (len * sizeof(wchar_t));[/icode] >>should I create a new pointer to convert from the unsigned char[]? No, just typecase it: [icode] int len = strlen((const char *)in)+1[/icode]

Member Avatar for Ancient Dragon
0
226
Member Avatar for gretty

Why are you bothering to count the number of integers in the file before actually reading them into the array? Your program doesn't do any dynamic allocation of the array, so what's the point of doing that? Just put the data in the array the first time the file is …

Member Avatar for Ancient Dragon
0
93
Member Avatar for boiishuvo

The code marked in [color=red]RED[/color] is for the menu item [b]statistics[/b] and I have no idea what that's supposed to do. >>Also can you tell me how to make a new menu item "DELETE MARK" See the function do_again(). Just add another menu item to what's already there and you …

Member Avatar for VernonDozier
0
529
Member Avatar for san gabriel

[QUOTE=csurfer;883926] P.S: Guys the person "san gabriel" doesn't know about string classes I suppose may be new to c++ so wouldn't the new info be better?[/QUOTE] No, at least not for the purpose of his assignment. He is probably learning about character arrays, not c++ STL classes.

Member Avatar for mirfan00
0
447
Member Avatar for hiscasio

hiscasio: also tell us what compiler you are using. And are you on *nix, MS-Windows, or something else?

Member Avatar for hawash
0
149
Member Avatar for s_sridhar

Did you select menu Build --> Build Solution? You have to do that before doing anything else.

Member Avatar for s_sridhar
0
116
Member Avatar for cmick56

>>is there a difference between call by reference and pass by reference?? No. They both mean the same thing.

Member Avatar for Ancient Dragon
0
142
Member Avatar for Nick Evan

Thanks for posting those links -- I've been wondering where they went. Made this thread sticky so that it stays where we can easily find it.

Member Avatar for csurfer
4
352
Member Avatar for san gabriel

you really don't need to use strtok() for this problem. All you need is strchr(). First locate the ')' charcter, copy that to areaCode character array. Then find the '-' character, copy that to exthange character array. Finally copy the remaining characters to the ext array. If you know how …

Member Avatar for siddhant3s
0
168
Member Avatar for Ancient Dragon

When I click a link IE8 always opens a new window instead of creating a new tab. I have clicked Tools --> Internet Options --> Tabs --> "Open Link In Other Programs In" --> "A new tab in current window". How can I set it so that a new tab …

Member Avatar for SanjitVigneshS
0
139
Member Avatar for mikeyw

[quote]And what did Larson do with his money? He paid the taxes on his winnings ($35,000) and invested the rest, most of it in vacant land in a real-estate deal to build homes back in Lebanon. "It didn't work out," he says. "We had a cash-flow problem, and I lost …

Member Avatar for Ancient Dragon
0
64
Member Avatar for Motiranjan

vc++ is the name of a Microsoft compiler, not a computer language. Is that what you meant? How to practice using the compiler: Just use it for some projects you can find anywhere on the net, including right here at DaniWeb. In addition to knowing how to create projects, you …

Member Avatar for Motiranjan
0
84
Member Avatar for Curtain51

>>values.erase (values.begin()); That should erase the entire array. Here is one way to print all the integers in the array [code] for(int i = 0; i < values.size(); i++) cout << values[i] << "\n"; [/code] Here is another way using an iterator [code] vector<int>::iterator it = values.begin(); for( ; it …

Member Avatar for Curtain51
0
127

The End.