15,300 Posted Topics

Member Avatar for The Dude

There are people all over the planet who apparently think God said "trains" instead of "brans", and told Him "No thanks.".

Member Avatar for Salem
0
81
Member Avatar for Pokenerd

Here is how to cut a section out of a std::string [code] int main() { string str = "Now is the time"; str.erase(4,3); cout << str << "\n"; } [/code] In your code, instead of 4,3 [icode]str.erase(textBox1.SelectionStart,textBox1.SelectionLength); [/icode] [edit]Too late -- already suggested :)[/edit]

Member Avatar for Ancient Dragon
0
93
Member Avatar for nanchuangyeyu

since the file is in binary mode you can write the matrix in one big swoop instead of one element at a time [icode]mat_file.write(reinterpret_cast<char*>(mp), row_sz * col_sz * sizeof(float));[/icode] With that you can delete that entire loop. And read it back with that same line, except change write to read.

Member Avatar for Ancient Dragon
0
189
Member Avatar for AirGear

The problem appears to be in winbgim.a -- The function cls_OnClose() calls exit(). If you download the source to that library you can change that behavior. But if you do that it may have other unintentional consequences, such as memory leaks.

Member Avatar for AirGear
0
420
Member Avatar for C++ Obliviator

you mean if the user types "Hello World" <Enter key>, you want to add '\n' to the end of the string?

Member Avatar for C++ Obliviator
0
140
Member Avatar for nirav99

This worked for me, using vc++ 2008 Express. But also note that conio.h is non-standard and not supported by all compilers. [code] #include <windows.h> #include <conio.h> #include <stdio.h> int main() { int c; printf("Enter something\n"); while( !_kbhit() ) Sleep(100); while( _kbhit() ) { c = _getch(); printf("%d\n", c); } } …

Member Avatar for tux4life
0
157
Member Avatar for Menster

My prediction is that Chrome will not have any impact on IT other than maybe for hobbyists. If it just sits on top of *nix then why bother with it?

Member Avatar for rishabhv
0
297
Member Avatar for DNDSH

what compiler are you using? Take the error messages one at a time, then recompile to get a new list. For example, main() is missing declaration of variable [b]i[/b] in a lot of places. The declaration of [b]i[/b] in the first for loop is only valid for that loop. I'd …

Member Avatar for Salem
0
131
Member Avatar for sfgal

between lines 15 and 16, just use string's find() method to locate the = symbol and then extract the remainder [code] size_t pos = songTitle.find('='); if( pos != string::npos) { songTitle = songTitle.substr(pos+1); // bypass the = } [/code] This assumes the string is something like this [icode]song title=Hello Dolly[/icode]

Member Avatar for Ancient Dragon
0
91
Member Avatar for mediachicken

Of course there is [code] int main(int argc, char* argv[]) { string args; for(int i = 1; i < argc; i++) { args += argv[i]; args += ' '; // add space between args } } [/code]

Member Avatar for Ancient Dragon
0
141
Member Avatar for special481

Welcome to DaniWeb and hope you joing in the discussions here. Feel free to browse all the forums and get acquainted.

Member Avatar for anamaria2513
0
27
Member Avatar for doublebond

It seems the problem is fscanf() -- it will only read up until the first white space( spaces, tabs, ets ). If you need the entire line then use fgets() to read the line and then parse it -- call strchr() to find the colon then extract the rest.

Member Avatar for Ancient Dragon
0
489
Member Avatar for poncho4all

might be useful to provide a link that explains that function so that people here know what you are asking. Also state the operating system and compiler.

Member Avatar for poncho4all
0
120
Member Avatar for Chaosis

search [URL="http://www.google.com/search?source=ig&hl=en&rlz=1G1GGLQ_ENUS328&=&q=how+to+monitor+data+between+usb+and+device&btnG=Google+Search&aq=f&oq="]these links[/URL] Some of them are very expensive -- $3,000+USD

Member Avatar for Ancient Dragon
0
95
Member Avatar for oall

Microsoft compilers no longer supports generating makefiles. Instead, it has a command-line tool to use the solution file. [URL="http://msdn.microsoft.com/en-us/library/f35ctcxw.aspx"]See this article[/URL].

Member Avatar for oall
0
335
Member Avatar for Ancient Dragon

When a post is flagged is it possible to disable that link so that others know it has already been reported ? Currently there is no way for members to know if a post has been reported or not, so we wind up with several people reporting them.

Member Avatar for WaltP
0
153
Member Avatar for oningsio

Since you didn't say what operating system or version you are using, my guess was to move it here.

Member Avatar for oningsio
0
83
Member Avatar for jephthah
Member Avatar for Ather14

If you want the C method [code] char iobuf[255]; long ints[255] = {0}; int i = 0; // get each line of the file while( fgets(iobuf, sizeof(iobuf), fptr) != NULL) { ints[i] = atol(iobuf); } [/code]

Member Avatar for Ancient Dragon
0
977
Member Avatar for UrbanKhoja

>>There's no place like home! I think that's true of most people around the globe. As for the 4th, I'm working at Wal-Mart today, one of the busiest days of the year. Yesterday was non-stop shopping from the time I went to work at 9:00 a.m. until long after I …

Member Avatar for Ene Uran
2
478
Member Avatar for daviddoria

Each has its own purpose: [icode]MyClass A;[/icode] will disappear from view then the function exits (unless its global), and you can not specify the type of object, whether it is grandfather of class B or class C. The only way to do that is to use a pointer. [code] class …

Member Avatar for Ancient Dragon
0
96
Member Avatar for edejonge

Cets are not the primary thing employers look for, but they may make a difference in distinguishing you from the other guys with the same education and experience.

Member Avatar for Ancient Dragon
0
84
Member Avatar for nirav99

inheritence means something like this: Class B can call the function from class A because class B inherited everything from class A. [code] class A { void SayHello() { cout << "Hello from class A\n"; } }; class B : public A { public: B() { SayHello(); } } [/code]

Member Avatar for Tom Gunn
0
147
Member Avatar for Himani_29

[QUOTE=Himani_29;912521] does sum1 make a solution for it..??? i m wrkin on DevC++[/QUOTE] No. We do not write your program for you, but we will help you write it yourself. Show us some effort, such as post the code you have tried, and ask specific questions about your code. But …

Member Avatar for Himani_29
0
210
Member Avatar for gustyJoey

If the military time is past 12:59 then just subtract 12. For example: 1300 - 1200 = 1:00 p.m.

Member Avatar for Ancient Dragon
1
77
Member Avatar for Chuck Norris123

Why would you want to use such an old compiler? Get the newest version VC++ 2008 -- [URL="http://www.microsoft.com/express/vc/"]the Express edition is free.[/URL], but it has its limitations, such as no support for MFC.

Member Avatar for Ancient Dragon
0
108
Member Avatar for astropirate

Example: "g++ -o out.a main.cpp" If you want that to be executed inside a C or C++ program: [icode]system("g++ -o out.a main.cpp");[/icode]

Member Avatar for ganbree
0
132
Member Avatar for melissa.johns

without buying $$$ some expensive profiling programs, that would be about the simplest way to do it.

Member Avatar for jephthah
0
101
Member Avatar for Salem

All those links are already available in your control panel.

Member Avatar for Salem
0
117
Member Avatar for csayantan
Member Avatar for umair125

shadwickman is right -- we are not here to write programs for people but to help them write their own programs. You will not learn anything if all you do is copy someone else's work. The first thing you need to do is sit down with pencil & paper and …

Member Avatar for Ancient Dragon
-1
480
Member Avatar for jaya1608
Member Avatar for ynaffit
Member Avatar for jackiesampieri

If you don't want to be here why the hell are you posting ?? Just go away.

Member Avatar for The Dude
-3
74
Member Avatar for Humbaba

use a loop and validate user input [code] while(true) { cout << "Enter a number\n"; cin >> number; if( !cin.good() ) { cin.clear(); cin.ignore(1000,'\n'); cout << "Error\n"; } else break; } [/code]

Member Avatar for Dave Sinkula
0
87
Member Avatar for shopnobhumi

>>cout<<sizeof(b)<<endl; The sizeof operator (its not a function!) returns the number of bytes occupied by the object. In the case of variable [b]b[/b] it is 6 integers and the size of one integer is 4 bytes, so simple math 6 * 4 = 24. The second one is a little …

Member Avatar for Ancient Dragon
0
174
Member Avatar for walter clark

A [URL="http://msdn.microsoft.com/en-us/library/ms997537.aspx"]Windows Hook [/URL]might do it.

Member Avatar for walter clark
0
73
Member Avatar for techied

It will probably depend on your education level -- are you college freshman or going for a Ph.D.? The difficulty of any project will depend on that. Is this for a computer language course (which one) or something else?

Member Avatar for SanjitVigneshS
0
439
Member Avatar for Darkmorgaine

Looks like its missing a close bracket } at the last line. What other compiler errors are you getting? What compiler and operating system are you using?

Member Avatar for sotvisal
0
234
Member Avatar for Menster

I was a coder for over 20 years and know no one who smoked marijuana. Tobacco yes, marijuana no. And it makes sense to me -- can't program when stoned or intoxicated.

Member Avatar for Menster
0
142
Member Avatar for mrnutty
Member Avatar for mrnutty
0
118
Member Avatar for qkslvr1621

put an else between the first two if statements, like you did between the last two statements.

Member Avatar for qkslvr1621
1
93
Member Avatar for Kadence

>>Visual Studio 2008, which I assume is a 64 bit compiler. No -- its a 32-bit compiler. But the Pro version can compile 64-bit code if you provide the right options. Just because you compile something on a 64-bit os doesn't mean you will automatically get a 64-bit program. Post …

Member Avatar for jbennet
0
159
Member Avatar for Ancient Dragon

Are you going to pre-order Windows 7? I have and got the Pro edition because it contains XP compatibility mode.

Member Avatar for jbennet
0
130
Member Avatar for zeus1216gw

2) The computer speed has nothing to do with srand(). srand() is used to see the random number generator so that it does not generate the same set of random numbers every time you run the program. 4) We are only a little peeved at newbies who want us to …

Member Avatar for zeus1216gw
0
142
Member Avatar for yakovm

What more information could there possibly be??? As you already stated its just a pointer to the current c++ class object. For example, here's the output of the following in c++. It shows that the this pointer is the same in both child and parent. [code] A: this = 2afc38 …

Member Avatar for BestJewSinceJC
0
219
Member Avatar for Ancient Dragon

This is not very far from where I live -- 170 ft water tower built in 1949 and restored in 1995. [url]http://www.catsupbottle.com/[/url]

Member Avatar for jbennet
0
75
Member Avatar for oricalc

As a user I almost never use site maps, I have never found a use for them.

Member Avatar for thehotspotguide
0
140
Member Avatar for AnkitKumar
Member Avatar for Samuelandjw

There is no point comparing the difference because such a comparison will be compiler dependent. How one compiler implements cout and printf might be different than how some other compiler implements them. One compiler might wrap cout with printf() while another compiler might wrap cout with win32 api function WriteFile() …

Member Avatar for MosaicFuneral
0
1K

The End.