6,741 Posted Topics

Member Avatar for collinskawere

This is a common problem with IDEs that don't artificially keep the window open for you. The actual problem is that the IDE creates a window to host your program, and when the program ends the window is destroyed. The solution is to force your program to continue running by …

Member Avatar for collinskawere
0
274
Member Avatar for valestrom

Your operations are out of order. Create a dialog object, initialize it, [i]then[/i] show it: [code] Info^ form = nullptr; try { form = gcnew Info(); form->name->Text = "Calculator"; form->infobox->Text = "Test"; form->ShowDialog(); } finally { if (form != nullptr) form.Dispose(); } [/code] This process makes the most sense from …

Member Avatar for valestrom
0
297
Member Avatar for truetexan

[QUOTE]I could not find a Build menu in 2010 Express.[/QUOTE] You can also right click on the solution in the solution explorer for the "Clean Solution" command. Projects can be cleaned individually this way as well by right clicking on the project.

Member Avatar for truetexan
0
152
Member Avatar for ahp@aol.in

[QUOTE]But how it is returning value to main, even we are not returning in code.[/QUOTE] You lied to the compiler and it's doing what you asked. The following says that calsum() returns an int: [code] int calsum(int a,int b,int c) [/code] Whether you actually return a value or not, the …

Member Avatar for D33wakar
0
175
Member Avatar for stereomatching

Um...set_difference() already has an overload that takes a predicate. Your call will work as-is: [code] std::set_difference( A.begin(), A.end(), B.begin(), B.end(), std::back_inserter(C), [](morph const A, morph const B) { return A.num < B.num; }); [/code]

Member Avatar for mike_2000_17
0
330
Member Avatar for dcazacu

Standard C++ doesn't support directory management, you'll need to use some sort of non-standard library. I'd suggest [URL="http://www.boost.org/doc/libs/1_47_0/libs/filesystem/v3/doc/tutorial.html#Directory-iteration"]Boost::filesystem[/URL] as a start.

Member Avatar for WaltP
0
246
Member Avatar for cool_vishalgang

There shouldn't be any case where you have an array but cannot acquire its size unless your code was poorly designed. Please post some code and describe the program you're trying to write so that we have a little context to work with in helping you.

Member Avatar for Narue
0
65
Member Avatar for Chavis

[QUOTE][CODE]Lottery<int>Lotto();[/CODE][/QUOTE] Welcome to C++, where syntactic ambiguity means you declared a function rather than an object. Remove the parens from this declaration and Lotto will become what you intended it to be: [code] Lottery<int> Lotto; [/code] And array2 isn't visible in main(), it's a private member of the Lottery class.

Member Avatar for raptr_dflo
0
162
Member Avatar for C++newbie chick

[QUOTE]So I don't think my do-while loop is right... I don't know how to keep shifting the structs down until the end though...[/QUOTE] The idea is to pretend the record being deleted is a hole in the array and fill it in with everything after it: [code] // Find the …

Member Avatar for chandara
0
859
Member Avatar for lllmcv

What's the problem? You realize that we can't read your mind and you need to tell us what you're having trouble with, right?

Member Avatar for emrecaglarhosgo
-1
95
Member Avatar for Zssffssz

[QUOTE]is there any way to just throw, let's say the first line to null read the second line feed the third and fourth to null and read the fith?[/QUOTE] Just read the line into a variable and don't do anything with it. When you read the next line, the variable …

Member Avatar for Labdabeta
0
145
Member Avatar for maynardjk13

The first problem is you read a number into x and print it out, but don't add it to the sum. The second problem is using fin.fail() as the loop condition, it's basically the same as [URL="http://www.gidnetwork.com/b-58.html"]using feof()[/URL], which is wrong. Try this instead: [code] // read text from file …

Member Avatar for maynardjk13
0
234
Member Avatar for terence193

[QUOTE]what is a _Bool variable?[/QUOTE] A variable of [URL="http://en.wikipedia.org/wiki/Boolean_data_type"]boolean type[/URL]. The keyword for a boolean type in C is _Bool. It holds only two values: 0 or 1, which correspond to false and true, respectively. C also provides a header called <stdbool.h> that defines more convenient macros: [ICODE]bool[/ICODE], [ICODE]false[/ICODE], and …

Member Avatar for Narue
0
140
Member Avatar for ndayala

Train A leaves the station at 4 p.m. 300 miles away, Train B leaves leaves at 6 p.m. If Train A travels 45 mph and Train B travels 60 mph, when will they meet?

Member Avatar for Narue
0
48
Member Avatar for Majestics

Certainly there's not a dedicated forum for secure coding, but discussions of such are on-topic in the [B]Software Development[/B] and [B]Web Development[/B] categories. Just because there's not a forum called <so and so> doesn't mean you can't start a thread discussing <so and so> in a forum that's "close enough".

Member Avatar for Narue
0
143
Member Avatar for sknake

[B]>Anyway, you are perma-banned from daniweb.[/B] That's worked soooo well, as we can plainly see. I think it's high time for Dani to complain to Josh's ISP and see about getting his account dropped. If he can't connect to the web, he can't circumvent his forum ban, can he?

Member Avatar for pseudorandom21
2
964
Member Avatar for mrgadgets

[QUOTE]Hi, I just want to know is c++ or maybe java the programming language which is used by most programmers to write those software programs we seen on cnet or clickbank?[/QUOTE] It might be neither. Learn a little bit about the advantages of each language and choose the one that's …

Member Avatar for Narue
0
103
Member Avatar for v3ga

There's an invisible control character on line 33. Delete the line and rewrite it.

Member Avatar for v3ga
0
2K
Member Avatar for chandara
Member Avatar for garu525

A pointer is not an array, it only plays one on television. You have to allocate memory to the pointer and then assign values, which for the purpose of this post we'll say you cannot do in a structure initialization list: [code] #include <iostream> #include <string> using namespace std; struct …

Member Avatar for garu525
0
5K
Member Avatar for sasho648

0x1A is the ASCII value for Ctrl+Z, which is the end-of-file character for a text stream on Windows. Since you're doing arbitrary seeking on the file anyway (an operation that's undefined for text mode streams), you can open the file as binary and that will fix the problem of 0x1A …

Member Avatar for sasho648
0
366
Member Avatar for efronefron

[QUOTE]So, can you see what is wrong with the program?[/QUOTE] I'd wager that it has something to do with your math. You're using the size of the buffer rather than the number of extracted characters to calculate the seek offset. Compare and contrast: [code] char *a3_fgets_2(char *str, int num, int …

Member Avatar for efronefron
0
267
Member Avatar for learner guy

[QUOTE]kbhit() is for any key but i want to modify it to a specific key ..[/QUOTE] kbhit() tells you if a key has been pressed. You can then use getch() to determine the value of the key. [QUOTE]i want to retrieve the x and y coordinates of of an object...how …

Member Avatar for Narue
0
1K
Member Avatar for dan1992

IT would be helpful if you actually stated what the error was, but I suspect it's due to using [ICODE]bool[/ICODE] (as well as [ICODE]true[/ICODE] and [ICODE]false[/ICODE]) either in C90 mode or in C99 mode while failing to include <stdbool.h>. But please note that being able to spot that has nothing …

Member Avatar for Stazloz
0
83
Member Avatar for mc3330418

It would probably be easier if you stored the times entirely as seconds and then converted to "<minutes>:<seconds>" for display purposes. I don't suspect that these times are likely to exceed the limits of one of the integer or floating-point types.

Member Avatar for Narue
0
120
Member Avatar for Nileshmendhe
Member Avatar for Narue
0
39
Member Avatar for egoleo

>I want to learn how to write a compiler. Okay, you need to know the language that the compiler processes inside and out, as well as assembly for all of the machines that the compiler will be run on (assuming you're compiling to machine code, it's easiest to output assembly …

Member Avatar for rubberman
0
759
Member Avatar for Nasas

[QUOTE][CODE]to_bin(dec,size); //using same function again[/CODE][/QUOTE] Yes, you're using the same function again. This is a recursive call with no base case, which means your error is a stack overflow. Try casting the arguments into an exact match for the overloaded function if you want to reuse it: [code] to_bin(static_cast<unsigned int>(dec), …

Member Avatar for Nasas
0
117
Member Avatar for ram619

[QUOTE]can anyone please tell me whats actually happening in this code.[/QUOTE] I'd have trouble writing worse code intentionally. If you got that code from a book, my recommendation is to burn the book so as to protect other hapless beginners from reading it. The author is clearly incompetent. [QUOTE]I ran …

Member Avatar for Narue
0
358
Member Avatar for stereomatching

[QUOTE]Some of my friends say it is useless to learn it, since there are no one would like to use it and you can't use it because there are no one know how to use it.[/QUOTE] There's some truth to that opinion. But avoiding the techniques doesn't make them any …

Member Avatar for vijayan121
0
258
Member Avatar for anerchy

You forgot to add a comma between the parent name and age values: [code] cmdtext = "insert into tblSTUDENT(FULLNAME, PARENTNAME, AGE) VALUES('" + txtStudentName.Text + "', '" + txtParentName.Text + "', " + txtAge.Text.ToString() +")"; [/code] Sometimes it helps to use string.Format() instead of concatenation because the formatting around placeholders …

Member Avatar for anerchy
0
246
Member Avatar for brainfo

[QUOTE]But its not working[/QUOTE] Not helpful. [U]How[/U] is it not working? What did you expect versus what it currently does?

Member Avatar for brainfo
0
104
Member Avatar for itai.dee
Member Avatar for FEC

You can find a simple random number generator in <cstdlib>. From there it's a simple matter of selecting N random values from a list of letters: [code] #include <cstdlib> #include <iostream> #include <string> int main() { std::string alphabet = "abcdefghijklmnopqrstuvwxyz"; for (int i = 0; i < 10; i++) std::cout …

Member Avatar for Narue
0
117
Member Avatar for mameemonster

The = operator assigns while the == operator tests for equality. You're using the assignment operator for equality, and C's implicit equality rules apply. Here's an example of your code: [code] if (type = 1) bus[99] = "Single-decker"; else bus[99] = "Double-decker"; [/code] Here's how C is really interpreting it: …

Member Avatar for mameemonster
0
115
Member Avatar for DeusManP0W

Could you post all of the code? The place where it's complaining isn't necessarily the source of the error. [QUOTE]Also wondering what this is: 1 D:\ANNAT\Dev-Cpp\include\c++\3.4.2\backward\iostream.h:31, from CRY\DICE.cpp In file included from D:/ANNAT/Dev-Cpp/include/c++/3.4.2/backward/iostream.h:31, from CRY/DICE.cpp[/QUOTE] GCC boilerplate in an error log. While it can be helpful, a lot of the …

Member Avatar for DeusManP0W
0
1K
Member Avatar for salah_saleh

You'll want to read a full line, then break it down into columns with something like stringstream: [code] #include <fstream> #include <iostream> #include <sstream> #include <string> #include <vector> int main() { std::ifstream in("test.txt"); std::vector<std::vector<int> > v; if (in) { std::string line; while (std::getline(in, line)) { v.push_back(std::vector<int>()); // Break down the …

Member Avatar for salah_saleh
0
6K
Member Avatar for nchy13

[QUOTE][CODE]redblacktree<int> *r; r=rb.search(90);[/CODE][/QUOTE] It looks like exactly what the error states. rb.search() returns a pointer to T, not a pointer to redblacktree<T>. Since the code for redblacktree::search() really does return a pointer to redblacktree<T>, your member function signature is wrong. IT should be: [code] redblacktree<T>* search(T y) { ... } …

Member Avatar for nchy13
0
165
Member Avatar for stevo7624
Member Avatar for raptr_dflo
0
133
Member Avatar for pyro 214

>Programmers focus more on writing the code. Software engineers >focus on a larger picture...cost of making the program, cost for >consumers, consumer usability, efficiency, and management of >the overall project. I'm going to go ahead and disagree with you on that one. Sure, [i]bad[/i] programmers focus more on writing the …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for Raaz_mystery

Unfortunately, Daniweb does not allow discussions about hacking, and cracking the security on archive files falls neatly under the definition we use for "hacking". Sorry.

Member Avatar for Narue
0
79
Member Avatar for Nimerion

[QUOTE]Can someone help me or give me info?[/QUOTE] Open your book to the chapter on I/O and read it. If you don't understand how to read an integer from input, that's the first step.

Member Avatar for jtbens01
0
166
Member Avatar for lelejau

The compiler is right, D3DXMATRIX doesn't have a member named "m". However, D3DMATRIX does have such a member, which suggests you're not using the type you thought.

Member Avatar for lelejau
0
963
Member Avatar for superjj

The very definition of an abstract method in C# is a function declaration without an implementation. Non-abstract derived classes are required to provide the implementation. If you want to provide a default implementation, the method should be virtual rather than abstract. If you want to keep it abstract just replace …

Member Avatar for Mitja Bonca
0
181
Member Avatar for neuro

Try Accelerated C++ by Koenig and Moo. While it may also be too fast if Thinking in C++ is too fast, I'd rather not recommend some of the more accessible books unless absolutely necessary because quality tends to drop rather quickly as the pedagogy methods are simplified.

Member Avatar for verona.jenn
0
238
Member Avatar for dan1992

Props for making an honest attempt at converting that Pascal program, but your translation is a bit lacking. Compare and contrast: [code] #include <stdio.h> void swap(int *a, int *b) { int temp = *a; *a = *b; *b = temp; } void tipareste(int a[], int n) { int i; for …

Member Avatar for dan1992
0
140
Member Avatar for coding101

[QUOTE]But where is the function body?[/QUOTE] In an object library somewhere, either statically or dynamically linked to your code when you build. Many libraries are linked for you by default, such as the standard C library and common POSIX libraries (which includes the things declared in sys/stat.h). Others will need …

Member Avatar for Narue
0
85
Member Avatar for ayeshashahid

The only application for bubble sort is in the classroom. It's a simple algorithm, arguably the simplest sorting algorithm, and well suited as an introduction to the concept. However, it's hideously inefficient even compared to other quadratic sorting algorithms.

Member Avatar for ayeshashahid
-1
2K
Member Avatar for corby

[QUOTE]The main() function is not allowed to be called inside a program.[/QUOTE] You're thinking of C++. It's legal in C (though rarely a good idea).

Member Avatar for Narue
0
144
Member Avatar for cse.avinash

Your j index is out of bounds because the inner loop test is [ICODE]arr[j] <= num[/ICODE] rather than [ICODE]j <= num[/ICODE]. You want to test the index, not the value stored at that index.

Member Avatar for cse.avinash
0
103

The End.