15,300 Posted Topics

Member Avatar for coveredinflies

command line arguments are entered into your program via main() function. it has two optional arguments [icode]int main(int argc, char* argv[]) [/icode] argc == number of arguments and always > 0 because the name of the program is 1 argv == array of characters that contain the strings that you …

Member Avatar for coveredinflies
0
107
Member Avatar for The Dude

That clip was sooooo boring, I had to stop it after a few seconds. The woman narriating that has a more boring voice than whats-his-name on tv who looks a lot like Henry Kissenger. I don't cut the grass any more -- I pay someone else to do it :)

Member Avatar for maydhyam
0
127
Member Avatar for Cosa

you can use std::transform() to convert the strings to either upper or lower class then use the comparisons [code] std::string s1 = "Hello"; std::string s2 = "HELLO"; std::transform( s1,begin(),s1.end(),s1.begin(),touper); std::transform( s2,begin(),s2.end(),s2.begin(),touper); if(s1 == s2) { // do something } [/code]

Member Avatar for Cosa
0
91
Member Avatar for manzoor

you need to clear the input stream of all the characters -- see the [b]Read Me[/b] thread about how to do that.

Member Avatar for Ancient Dragon
0
122
Member Avatar for m_banerjeein

1) [b]static[/b] is a scope operator that limits the scope of the function to the *.c file in which it is declared. If you have two *.c files, each file could contain a function with the same name as long as the function is declared static. IMO its poor programming …

Member Avatar for jephthah
0
129
Member Avatar for pipisumthin

you can also call standard C function fstat() or stat(), which will return error if the file is not found. And if it is found it will tell you how big it is -- you can use that info to compare with the original file to see if they are …

Member Avatar for WaltP
0
257
Member Avatar for flecture

1) what are the errors -- or do we have to guess??? 2) you have two main() functions declared. One in the header, where it should NOT be. 3) void main() -- don't use it. main() ALWAYS returns an int. [URL="http://www.gidnetwork.com/b-66.html"]Click here.[/URL] for more info about that.

Member Avatar for jephthah
0
83
Member Avatar for lil_panda

[URL="http://www.mkssoftware.com/docs/man3/strtol.3.asp"]strtol()[/URL] If you want to use pure c++ then use stringstream c++ class.

Member Avatar for Radical Edward
0
631
Member Avatar for STUDENT#101

Ok, you stated what the program is supposed to do, now tell us what you did to solve it. Don't know where to start? Try this: [code] int main() { // your code goes here } [/code]

Member Avatar for STUDENT#101
0
141
Member Avatar for bookgirlboss

As a former tech lady you obviously know it is illegal for anyone to give you a key. The only way to get it is either 1) from HP, who refuses your request, or 2) buy another copy of XP. And thanks for the info about the Trojan.

Member Avatar for sittas87
0
240
Member Avatar for dexter1984

first problem: the while statement is incorrect. Here is how to do it. [icode]while( stats.getline(counter,200) )[/icode] Why do you think strlen() doesn't work? Its been working correctly for millions of programmers all over the globe for over 25 years, so I doubt it has a bug.

Member Avatar for Ancient Dragon
0
118
Member Avatar for masterjiraya

depends on the error message. compile your program for debugging and find out what's causing the problem.

Member Avatar for mitrmkar
0
155
Member Avatar for Scuppery

If you are going to plagerize something you would at least post the link where you stole it. [url]http://www.funny2.com/mensrules.htm[/url]

Member Avatar for abetageek
-2
275
Member Avatar for arun_lisieux

The problem is on line 46. The first time through where is only one number in the vector and iterator [b]it[/b] is set to tx.end() because you incremented it on line 44.

Member Avatar for arun_lisieux
0
154
Member Avatar for scarypajamas

I don't do MAC but I see two possibilities. The data directory is directly off the root directory [icode]std::string add = "/data/scripts/";[/icode] or The data directory is a subdirectory of the current working directory. [icode]std::string add = "./data/scripts/";[/icode]

Member Avatar for iamthwee
0
1K
Member Avatar for chanderk

>>The reason for my question was not getting the difference. Ok, so what is it that you wanted to ask? >>I would ask to the point in future.... Absolutely! you can't be vague around here because if you don't know what you want we sure won't either.

Member Avatar for Ancient Dragon
0
139
Member Avatar for JackDurden

the sort algorithm is wrong. You have to swap all elements of grades array at the same time that the string in word is swapped. You can delete aName2 array. [code] if (word[k] < aName) { // first swap the string in the word array aName = word[k]; word[k] = …

Member Avatar for Ancient Dragon
0
130
Member Avatar for soppyhankins

[QUOTE=soppyhankins;667295]HA! I just realized I spelled please wrong in the title! That's embarrassing. Lol!![/QUOTE] Ok -- now I'm going to have to ban you for misspelling that word :) Unless you have a Ph.D. in English, don't worry about the small stuff.

Member Avatar for soppyhankins
0
252
Member Avatar for saneeha
Member Avatar for ederX
Member Avatar for Radical Edward
0
1K
Member Avatar for vulpecula

post the first two lines of the actual file [code] 100 101something 102another 103yetanother [/code] something like above? Here is an example of how you might do it. This technique should work with an input stream instread of using stringstream in my example [code] #include <string> #include <sstream> #include <iostream> …

Member Avatar for Lerner
0
185
Member Avatar for sneekula
Member Avatar for shinsendaddy

maybe you should browse [URL="http://www.phpbb.com/development/"]around here[/URL].

Member Avatar for Ancient Dragon
0
16
Member Avatar for ahmbil

all you want to do is save the digits and/or characters of the barcode, not the graphics itself. When the scanner reads a barcode it sends the info to the pc. All your program has to do is look it up in the database. The barcode digits/characters itself is the …

Member Avatar for Ancient Dragon
0
103
Member Avatar for ++C LOVER

I've developed over 40 applications for Mobile 5.0 and Pocket PC using Visual Studio C++. I was able to accomplish a lot of things that most likely are not possible to do with Java, such as forbidding users to access the Today screen, disabling the Start button and the big …

Member Avatar for peter_budo
0
149
Member Avatar for bigjonah
Member Avatar for sittas87
0
123
Member Avatar for bookgirlboss
Member Avatar for glecymay

Google is your friend if you bother to use it at all. Read [URL="http://www.google.com/search?hl=en&q=c+binary+to+decimal"]this[/URL] and [URL="http://www.daniweb.com/code/snippet109.html"]this[/URL]

Member Avatar for glecymay
0
195
Member Avatar for jittersonson

Scientists normally have Ph.D. in one of the fields of science, such as math, physics, chemstry, biology, etc. [quote="An Engineer"][URL="http://en.wikipedia.org/wiki/Engineer"]Laws exist in all U.S. states, Canada and in South Africa which limit the use of several engineer titles, particularly the title of "Professional Engineer," and often also titles indicating a …

Member Avatar for jittersonson
0
140
Member Avatar for coveredinflies

A 2d character array? [icode]void foo(char* ay[][255] )[/icode] or like this:[icode]void foo(char **ay)[/icode]

Member Avatar for ArkM
0
455
Member Avatar for robertmacedonia

[URL="http://forums.devshed.com/c-programming-42/using-std-namespace-what-does-it-mean-45679.html"]This [/URL]is a good explaination. Whether to use [b]using namespace std;[/b] or not to use it is more of a personal preference than anything else. There is no right or wrong way to do it.

Member Avatar for William Hemsworth
0
256
Member Avatar for olagh

The constructors are not PUBLIC. What compiler are you using? Did it produce any warnings or errors that you failed to correct? You should treat all warnings as if they are errors because most of the time warnings are indeed errors.

Member Avatar for olagh
0
154
Member Avatar for Y_Game

read all about binary search algorithms from [URL="http://www.google.com/search?hl=en&q=binary+search+c+algorithms"]these google links[/URL].

Member Avatar for Aia
0
133
Member Avatar for JackDurden

line 9: remove the stars. Also, I assume [b]lastname[/b] is std::string ?? If simple character array then that comparison won't work. line 12: should sort the entire structure, not just one of its members [icode]Swap(&gradclass[firstUnsorted], &gradclass[smallest]);[/icode]

Member Avatar for ArkM
0
162
Member Avatar for Psykocyber

this might be one way to resolve the different parameters problem. Pass the parameters you want as the seccond parameter and use stdargs.h to retrieve them. If you don't want to do that, then you might get away with using templates, but someone else will have to answer that question. …

Member Avatar for Psykocyber
0
5K
Member Avatar for denbecker

OUCH! YOU HEART MY ERARS WITH YOUR SHOUTING!!! 1) post error message(s) 2) post enough code to illustrate the problem. We have no clue what STL contains you are using.

Member Avatar for Salem
0
118
Member Avatar for madankumar

My guess is that there are lots of ways to make it fail. Just pass the wrong parameters. [url]http://middleware.its.state.nc.us/middleware/Documentation/en_US/htm/csqzal06/csqzal0629.htm[/url]

Member Avatar for Ancient Dragon
0
53
Member Avatar for ++C LOVER

>>Now you can use the usual union membership operator to assign values to individual fields: NO YOU CAN'T. The union is used to assign the same memory location to several different POD (Plain Old Data) type objects. All the objects in the union below occupy the same space, and the …

Member Avatar for Alex Edwards
0
579
Member Avatar for anshulagarwal

You need to post code and the first fiew error messages (certainly NOT all 88 errors!). I just compiled this with VC++ 2008 Express without error [code] struct data { int x,y; double s,w,e,d; }d[5000],f[5000]; int main() { } [/code]

Member Avatar for jesseb07
0
147
Member Avatar for Alex Edwards

erase() just removes an object from the vector, it does not delete the object. I would write that releaseAll() function like this: [code] static void releaseAll(){ std::vector<ManagedClass*>::iterator first = track.begin() while( first != track.end() ) { delete *first; first++; } track.erase(track.begin(),track.end()); } [/code]

Member Avatar for Alex Edwards
0
118
Member Avatar for VIeditorlover

MS-Windows is not a real-time operating system, so no matter what you try the signals might or might not arrive to your program on time. You might try the [URL="http://msdn.microsoft.com/en-us/library/aa363196(VS.85).aspx"]Communications Resources[/URL] link

Member Avatar for VIeditorlover
0
125
Member Avatar for rayvai
Member Avatar for Ancient Dragon
0
34
Member Avatar for flipjoebanana

If you want your own memory block to act like the memory pool allocated by malloc() then you have to write some sort of memory management functions for the pool. Use malloc() only to allocate the initial memory block. After that your program has to keep track of free blocks …

Member Avatar for Ancient Dragon
0
99
Member Avatar for gispe

std::string is declared in the header file <string>, not <string.h>. The error you reported is because you failed to include <string> in your program. strcat: You failed to declare name large enough to hold both last name and first name, so if you enter last name with 18 characters and …

Member Avatar for CoolGamer48
0
335
Member Avatar for anshulagarwal

>>i am getting right result which means my coding is absolutely correct. Not necessarily. Did you write pure ANSI C or C++ ? Or did you mix it in with Borland-specific functions ? Just because it compiles with Borland doesn't mean diddly squat if it can't be compiled with other …

Member Avatar for VernonDozier
0
244
Member Avatar for chanda gul

Why do you have all that MFC stuff in a console program? line 54 is illegal. You can't do that -- its not accessing the memory location on a floppy but a memory location somewhere on your computer's RAM. How to do what you want: I don't know.

Member Avatar for Salem
0
129
Member Avatar for soppyhankins

declare a character array that is large enough to contain the filename and all the arguments, then pass that to the system() function. Example: [code] char command[512] = {0}; char filename[255]; printf("Enter a file name\n"); fgets(filename,sizeof(filename),stdin); // remove '\n' filename[strlen(filename)-1] = 0; sprintf(command,"HandBrakeCLI -i /dev/hdc -o /root/%s -b 1024 -B …

Member Avatar for soppyhankins
0
98
Member Avatar for AlanZinober

Its hard to say why that code isn't working, since we have no idea what Output and Ode are -- resumeably c++ classes. That would normally not be a problem.

Member Avatar for AlanZinober
0
151
Member Avatar for jack1234

You are using a compiler with the world's best debugger. You don't need debug messages. Just compile your program for debug and use the debugger to set breakpoints, see the value of variables and program execution. But to answer your question, how to print debug messages depends on whether you …

Member Avatar for bugmenot
0
3K
Member Avatar for besktrap

post code. you need to store the filename in either a character array or std::string. Example: [code] #include <iostream> #include <string> using namespace std; int main() { std::string filename; cout << "Enter a filename\n"; getline(cin, filename); cout << filename << "\n"; } [/code]

Member Avatar for VernonDozier
0
101

The End.