6,741 Posted Topics

Member Avatar for MeSam0804

What do you mean by raw data? Querying the tables into a DataSet object is about as raw as it gets.

Member Avatar for MeSam0804
0
141
Member Avatar for gruffy321
Member Avatar for jmcginny5

[QUOTE]I really have no idea how to do it.[/QUOTE] Not paying attention in class, then? [QUOTE]But this is what I have done so far[/QUOTE] Which is to say nothing, because all of the member functions are empty. Writing the declarations doesn't really count as doing anything, much as I'd like …

Member Avatar for jmcginny5
0
2K
Member Avatar for jingda

This is a new feature for voting on posts. Before there was no option to undo a vote, now the option you selected (either up or down) will be shown with an undo icon. By clicking that and refreshing the page, you can remove your previous vote. The idea is …

Member Avatar for Dani
1
155
Member Avatar for cppgangster

There's no such feature in the stdio library. The best you can do is extract a character, then return it to the stream with [URL="http://www.cplusplus.com/reference/clibrary/cstdio/ungetc/"]ungetc[/URL], but that's probably sufficient for your needs. If you need to unget more than one character, some custom buffering will be required to retain portability.

Member Avatar for Ancient Dragon
0
152
Member Avatar for SOME one2020

There are three issues: [B]>#include <iostream.h>[/B] Depending on the age of your compiler, this may or may not work. <iostream.h> has been replaced with <iostream> and all contents placed in the std namespace. [B]>main()[/B] C++ does not support implicit int. You must specify the return type of int. [B]>char std1[20], …

Member Avatar for SOME one2020
0
88
Member Avatar for mbouster

[QUOTE]Can someone suggest from where to start.[/QUOTE] I'd start by creating a random connected graph (the simulation framework). Then you have the structure required to add a flooding algorithm. [QUOTE]I will use structs or classes?[/QUOTE] Probably a good idea for the nodes of the graph. [QUOTE]How the flow of the …

Member Avatar for mbouster
0
2K
Member Avatar for eman 22

[QUOTE]An array is a pointer (to the zero-th element)[/QUOTE] No, an array is not a pointer. An array name when used in value context will be converted to a pointer to the first element, but this conversion does not take place in an object context. You can verify that this …

Member Avatar for mike_2000_17
0
88
Member Avatar for IDC_Sharp
Member Avatar for Razer_90
0
144
Member Avatar for jeffpro

[QUOTE]error C2664: '_stricmp' : cannot convert parameter 1 from 'WCHAR [260]' to 'const char *'[/QUOTE] That's a perfectly rational error. Your string is of type WCHAR and _stricmp clearly only accepts strings of char. On the assumption that you're using a compiler which supports it, try _wcsicmp instead of _stricmp.

Member Avatar for Narue
0
120
Member Avatar for pravej

Create an index at both ends of the string and swap characters, moving the indices closer until they meet. When they meet (or pass), the string will be completely reversed.

Member Avatar for template<>
0
246
Member Avatar for Gnomy
Member Avatar for template<>
0
547
Member Avatar for sinatra87

[QUOTE]A friend of mine just informed me that VS 2010 removed the feature where VS keeps the cmd window open when you start w/o debugging.[/QUOTE] Your friend is incorrect, though it's no longer a default setting. You can go to the project properties, Configuration -> Linker -> System, and set …

Member Avatar for sinatra87
0
2K
Member Avatar for SourabhT

[QUOTE]when i typecasted the base object to derived then pointer should call the fun() of derived (from virtual function call mechanism )[/QUOTE] When working with polymorphism there are two types in action: [list] [*][B]Actual Type[/B]: The type of the object itself [*][B]Virtual Type[/B]: The type of the pointer or reference …

Member Avatar for arkoenig
0
721
Member Avatar for fibbo

I think you're expecting us to be psychic. Can you provide a little context here instead of starting somewhere in the middle?

Member Avatar for fibbo
0
368
Member Avatar for hawita
Member Avatar for Fbody
0
316
Member Avatar for tkdlady

It's the [URL="http://en.wikipedia.org/wiki/C_preprocessor#Token_concatenation"]concatenation[/URL] operator.

Member Avatar for tkdlady
0
174
Member Avatar for predator78

[QUOTE]so far I seem to understand how they work "I think" at this stage[/QUOTE] I think you're still fuzzy on the distinction between data structures and classes. It helps to think of data structures as more of an abstract concept while classes are a concrete implementation detail. A data structure …

Member Avatar for NicAx64
0
379
Member Avatar for aprilchica3

For each line you re-open the outfile in ios::out mode. This will always overwrite the file starting at position 0. Try opening outfile once before the loop: [code] ofstream outfile(file1); while (infile.getline(line,200)) { line[0] = toupper(line[0]); outfile<< line <<'\n'; } [/code] Note that using eof() as a loop condition is …

Member Avatar for aprilchica3
0
176
Member Avatar for sha11e

Everyone has a different opinion. Though I haven't heard much advocacy of C over C++ for "fast" programs. Usually C is viewed as the obsolete parent of C++. [QUOTE]Heard people say c# for big programs, c for fast programs[/QUOTE] Big programs cannot be fast? [QUOTE]c++ is just something that failed …

Member Avatar for sergent
0
213
Member Avatar for L0s3r

[QUOTE]No copy constructor is called. Whereas it should be.[/QUOTE] Actually, it shouldn't be. You're trying to use the copy assignment operator, not the copy constructor. A use of the copy constructor would be [iCODE]mymatrix c3 = c1 + c2;[/iCODE]. Generally, if you need a copy constructor, you also need a …

Member Avatar for L0s3r
0
190
Member Avatar for pengkeanh

I think you're over-complicating this. Though it would help if you could be more specific about [i]how[/i] data1 and data2 would be related. What kind of data are we working with? The choice of how to work with it does depend somewhat on how it's being used.

Member Avatar for pengkeanh
0
370
Member Avatar for jrp370

1985 is calling, they want their code back. I'm not surprised if you're using a modern compiler and getting warnings about K&R style C.

Member Avatar for Narue
0
503
Member Avatar for WolfShield

[QUOTE]does anyone know at what posting number it changes to the next title, and/or what all of the titles are?[/QUOTE] Yes, and yes. But half the fun is seeing what comes next as you continue to post. :)

Member Avatar for WolfShield
0
191
Member Avatar for tikoti

[QUOTE]I am looking for something to compact the clear and push_back in one line...[/QUOTE] Why? [QUOTE]Any sugestion or idea?[/QUOTE] Nothing built into std::vector presently supports this. You'd have to add at least one line to get rid of one line, which nets you nothing.

Member Avatar for tikoti
0
172
Member Avatar for dyingatmidnight

Your SSBL constructor is creating a new local Telegram object called tele that hides the private member called tele. So you're not actually initializing the private member at all.

Member Avatar for Narue
0
96
Member Avatar for geekme

I notice your source file is called mule.c. Most likely your compiler is automatically detecting the desired language from the source file extension, which means you're not compiling as C++ but as C. C doesn't support the <iostream> header. Try forcing the compiler to compile as C++, or change the …

Member Avatar for JasonHippy
0
779
Member Avatar for aska07
Member Avatar for aska07
0
159
Member Avatar for IndianaRonaldo

[QUOTE]Because this constant data ("asd", "QWE", etc.) is stored in a special read-only section in memory you are getting a segmentation fault.[/QUOTE] Just a clarification: String literals [i]may[/i] be stored in read-only memory. Borland compilers in particular have historically allowed modification of string literals due to not storing the string …

Member Avatar for IndianaRonaldo
0
348
Member Avatar for dimmu1
Member Avatar for GhostMonkey

Sure, just store the previous value somewhere and assign it to p when you want to go back.

Member Avatar for L7Sqr
0
1K
Member Avatar for rockerjhr

Preprocessor macros must be all on one line. You'll typically see multi-line macros extend the line by using the \ character: [code] #define PUSH(s,c) \ if(push_char(s,c) == ERROR){ \ printf("Fatal error in pushing symbol on stack.\n") ; \ exit(1) ; \ } [/code]

Member Avatar for Narue
0
258
Member Avatar for marrkee

Compare and contrast: [code] #include <iostream> #include <fstream> #include <time.h> #include <stdio.h> using namespace std; tm *gettime() { time_t rawtime; time(&rawtime); return localtime(&rawtime); } int main() { cout<< asctime(gettime()); } [/code]

Member Avatar for marrkee
0
144
Member Avatar for newack

[QUOTE]When i run it, it throws exception and says "object reference not set to an instance of an object" what could be the problem?[/QUOTE] I suspect you have an object reference not set to an instance of an object. :icon_rolleyes: The error is very specific; you need to look for …

Member Avatar for Narue
0
73
Member Avatar for alex1050

You can break a number down with division and remainder: 123 % 10 = 3 123 / 10 = 12 These two operations will allow you to test both digits.

Member Avatar for CoilFyzx
0
882
Member Avatar for sha11e

[QUOTE]Is it true that IDE/compilers will automatically include some things?[/QUOTE] It's possible, yes. [QUOTE]If yes, is there a compiler for windows that won't?[/QUOTE] The proper solution is to know exactly what you're using and explicitly include the correct header. If you're expecting the compiler to catch every error, you'll be …

Member Avatar for Narue
0
299
Member Avatar for p.user01

[QUOTE]All the results does not match up with my understanding of C.[/QUOTE] This is because you haven't yet learned the sequence point rule concerning modifications. The rule states that an object may be modified at most one time between sequence points, otherwise the result is undefined behavior. The + operator …

Member Avatar for WaltP
0
312
Member Avatar for yakovm
Member Avatar for Narue
0
68
Member Avatar for chester1908

[QUOTE]But if i use a non-integer position counter[/QUOTE] I fail to see how your requirement leads to needing a non-integer index.

Member Avatar for chester1908
0
151
Member Avatar for ErickN

This would be a good fit for strtok, if you're not locked into sscanf for any reason: [code] #include <stdio.h> #include <string.h> int main(void) { FILE *in = fopen("test.txt", "r"); char line[BUFSIZ]; if (in != NULL) { while (fgets(line, sizeof line, in) != NULL) { char *tok = strtok(line, ","); …

Member Avatar for ErickN
0
961
Member Avatar for davelee

You'd still have to put it in a loop: [code] #include <ios> #include <iostream> #include <limits> using namespace std; int main() { bool done = false; int number; while (!done) { try { cout<<"Enter a number: "; if (!(cin>> number)) throw -1; done = true; } catch (int) { cerr<<"Invalid …

Member Avatar for davelee
0
1K
Member Avatar for xanawa

Make sure that dgvReservartion.Rows[a].IsNewRow isn't true. If your data grid view allows users to enter new rows directly, that last row with the * tends to be problematic.

Member Avatar for xanawa
0
106
Member Avatar for cableguy31

Post your full code. If it's too long, pare it down into something complete, but with all of the relevant parts. Trying to troubleshoot with tiny snippets is frustrating.

Member Avatar for Narue
0
741
Member Avatar for pengkeanh

How does CheckMemUsage work? It could be you're expecting the memory management to be handled in a different way than reality.

Member Avatar for Aranarth
0
290
Member Avatar for ichigo_cool

Read an int, then ignore a single character. Optionally peek to see if the character is a comma for more robust error checking: [code] for (int i = 0; i < 2; i++) { for (int j = 0; j < 4; j++) { if (!(in>> a[i][j])) break; in.ignore(); } …

Member Avatar for ichigo_cool
0
4K
Member Avatar for shyla

squareRoot is not declared before it's used. Either move the definition above main, or add a prototype: [code] #include <iostream> #include "ArithmeticHeader.h" using namespace std; int squareRoot(int number); int main() { [/code]

Member Avatar for shyla
0
2K
Member Avatar for Stogie2

You can't initialize an array member in the initialization list. It has to be done in the body of your constructor. If you're creating an array of a user-defined type, that type must also support default construction.

Member Avatar for Stogie2
0
215
Member Avatar for Wakesta

[QUOTE]Many old c++ compilers use now-deprecated iostream.h[/QUOTE] For the record, deprecated means that something is in the C++ standard but not recommended because it might be removed in future revisions. iostream.h wasn't, and isn't, part of the standard at all. [QUOTE]error: iostream: No such file or directory error: expected '=', …

Member Avatar for Wakesta
0
208
Member Avatar for merse

[QUOTE]But it is now slower! Why?[/QUOTE] At this granularity, it's probably system noise. Have you nailed down performance requirements, profiled your code, and determined that what you have is presently too slow?

Member Avatar for Narue
0
163
Member Avatar for abhimanipal

If you're just trying to display the result, something like this would work: [code] $ cat /dev/random | od -tl -w4 [/code] Remember that /dev/random is just a file. You can process it like any other file.

Member Avatar for Narue
0
125

The End.