15,300 Posted Topics

Member Avatar for Susmita_Sikder

both Code::Blocks and vc++ 2010 Express are current and free. If you want the source code to be compatible with *nix then use Code::Blocks because that compiler is available on both operating systems.

Member Avatar for Ancient Dragon
0
174
Member Avatar for shaker naser

The trick to writing complex programs is to break it down into much smaller parts. For example the first thing you want to do is write a program that lets you enter the date as a character array. Once you have that working, take the char array and break it …

Member Avatar for thines01
0
320
Member Avatar for UrbanKhoja

I don't use any of them -- just a PC, simple and cheap Sprint cellphone (with no internet connection) and a Samsong tablet. >>I know it’s a question that is not only as old as time itself You aren't very old, are you :) :) They've only been around since …

Member Avatar for peter_budo
0
297
Member Avatar for nandosss

Create it exactly like you would a 1d array but twice as large. If its an integer array then it needs to be sizeof(int) * 20 * 20 bytes, or 4*20*20 = 1600 bytes.How you store the data is pretty much up to you. One way is to store all …

Member Avatar for Ancient Dragon
0
4K
Member Avatar for jhey_2oo5

Yes, linked lists can be a bit tricky to program. Study some of [URL="http://www.google.com/#hl=en&sclient=psy-ab&q=c%2B%2B+linked+list+tutorial+beginners&pbx=1&oq=c%2B%2B+linked+list+tu&aq=1&aqi=g2g-j1g-jC1&aql=&gs_sm=1&gs_upl=0l0l1l367l0l0l0l0l0l0l0l0ll0l0&gs_l=hp.1.1.0l2j0i18j0i18i33.0l0l1l367l0l0l0l0l0l0l0l0ll0l0&bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&fp=7474e8d0b895000c&biw=1033&bih=518"]these links[/URL]

Member Avatar for toimelin
0
249
Member Avatar for tom12

The solution is identical to the RemoveSpaces() program I showed you in the other thread except check for vowels instead of saces.

Member Avatar for Ancient Dragon
0
105
Member Avatar for sreevisakh2007

there is no problem with malloc() -- what you see is called undefined behavior, or array out-of-bounds error. The compiler won't complain about it because it assumes (usually wrongly) that you know what you are doing. What happens when you do that? The program just scribbles stuff all over memory, …

Member Avatar for Ancient Dragon
0
153
Member Avatar for Japp007

Welcome Granny :) This is Grandpa, also retired military :)

Member Avatar for Denden17
0
134
Member Avatar for Ancient Dragon

What is this new advertising I see in threads -- some words look like links but when I hover the mouse over them an advertisement pops up.

Member Avatar for Ancient Dragon
0
213
Member Avatar for tom12

here is one way to do it [code] void RemoveSpaces(char *str)7 { int i = 0; int length = strlen(str); while(i < length) { if( isspace(str[i]) ) { memmove(&str[i], &str[i+1], length-1); --length; } else ++i; } } [/code]

Member Avatar for tom12
0
185
Member Avatar for eve_moore

First you will have to port the c++ code to cli/c++ (managed code) then put it in a DLL. If you don't know how to create a dll then learn how to do it -- [URL="http://msdn.microsoft.com/en-us/library/ms235636.aspx"]here[/URL] is a tutorial. Next read through a couple of [URL="http://www.google.com/#hl=en&gs_nf=1&cp=27&gs_id=30&xhr=t&q=how+to+call+cli%2Fc%2B%2B+from+C%23&pf=p&output=search&sclient=psy-ab&rlz=1C2CHFX_enUS452US455&pbx=1&oq=how+to+call+cli/c%2B%2B+from+C%23&aq=f&aqi=&aql=&gs_sm=&gs_upl=&gs_l=&bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&fp=994a272661dedc15&biw=1735&bih=908"]these google links[/URL] to find …

Member Avatar for eve_moore
0
300
Member Avatar for Massa3332

When you enter a number you have to press the <Enter> key, right??? Well, scanf() leaves that '\n' <Enter> key in the keyboard so the next time scanf() or some other keyboard function is called all it will get if the '\n' Enter key. what you have to do is …

Member Avatar for Arch Stanton
0
210
Member Avatar for ads1188
Member Avatar for Ancient Dragon
0
155
Member Avatar for SpiderMan120988

It would be alot simpler if you stored the words in a structure so that the English and French words can be kept together. [code] struct words { char English[max_word_len]; char French[max_word_len]; } [/code] Then make an array of structures [icode]struct words array[40];[/icode] You might also have to change the …

Member Avatar for Ancient Dragon
0
962
Member Avatar for johnnydarten

1. Move those two huge arrays on lines 15 and 16 up above main() so that they will not be on the limited stack. 2. All array idices are numbered 0 to, but not including, the declared array size. So an array with 800 elements are numbered 0 to 799. …

Member Avatar for johnnydarten
0
172
Member Avatar for jeevsmyd

Also, was temp initialized before calling strcat() the first time? eg. [icode]char temp[50] = {0};[/icode]

Member Avatar for Ancient Dragon
0
243
Member Avatar for DarkMonarch

One common way is to allocate memory in fixed block sizes. When that fills up then allocate a larger array. Here is an example [code] int array_size = 0; // initial array size int elements_used = 0; // current number of elements used in the array int *array = NULL; …

Member Avatar for DarkMonarch
0
194
Member Avatar for Prisms

It might depend on what language you want to write your program with. excel spreadsheets are very difficult, if not impossible, to work with in most languages (vb.net is one exception). A better and more portable solution is to create a database with either MS-Access (not free) or MySQL (free)

Member Avatar for Prisms
0
204
Member Avatar for SgtMe

you need to convert the integer to a char*, not char. [code] char score2[20]; sprintf(score2,"%d", score); [/code]

Member Avatar for Ancient Dragon
0
407
Member Avatar for angelineang

line 13: exit is the name of a standard c or c++ function. Give that variable a different name. line 1163: don't call main() anywhere in your program. That function should only be called by the operating system. If you need to repeat the code that is in main() then …

Member Avatar for Ancient Dragon
0
305
Member Avatar for SgtMe

You have to format that char* before calling TextAdd(). There are several ways to format it, one way is to use std::stringstream from <sstream> header file, another way is to use sprintf(). [code] #include <sstream> int main() { int score = 123; stringstream str; str << score; std::string s; s …

Member Avatar for SgtMe
0
10K
Member Avatar for aderogba08
Member Avatar for evanovan
Member Avatar for evanovan
0
175
Member Avatar for sujan.dasmahapa

Line 12 is pretty much useless. If LoadLibrary() fails then there is no reason to call FreeLibrary(). Call FreeLibrary() only when the process is done using it. Also, add an error message and return on line 13 when LoadLibrary() fails. Why it fails to work the second time, I don't …

Member Avatar for sujan.dasmahapa
0
390
Member Avatar for hilt_m

The reason is there is a maximum value that an integer can hold -- the maximum is declared in the header file limits.h that is supplied by your compiler. What you are seeing is called numeric overflow. If you need bigger numbers then use a bigger integer, such as "long …

Member Avatar for Ancient Dragon
0
92
Member Avatar for vaultdweller123

I use Chrome and never have that problem. Most likely a problem with the cookies on your computer. If you delete the DaniWeb cookies then yes, you will have to log in manually again.

Member Avatar for Ancient Dragon
0
95
Member Avatar for bobanderson93

use getline() instead of >> operator. [icode]fin.getline(string2, sizeof(string2));[/icode] Or if you use std::string [code] std::string string2; getline(fin, string2); [/code]

Member Avatar for Ancient Dragon
0
108
Member Avatar for valox
Member Avatar for phummon

Post the entire program because the code snippet you posted compiles ok for me using vc++ 2010 express compiler/IDE. [edit]I used the exact same code as ^^^ posted.

Member Avatar for phummon
0
257
Member Avatar for Silver-Eye

lines 30-32: the value of k is a negative number when i is 0. Do the first time through using k as index is illegal because there is no such thing as -1 index of arrays.

Member Avatar for zeroliken
0
165
Member Avatar for bryeguy2012

You can't fix it with that compiler because that compiler version is too old. Get free Code::Blocks with MinGW ([URL="http://www.codeblocks.org/"]link here[/URL]), which is current.

Member Avatar for jaskij
0
324
Member Avatar for CKShia

That's not possible unless you are writing a compiler and then it would be a compile-time check, not a runtime check.

Member Avatar for Ancient Dragon
0
202
Member Avatar for FelineHazard

No. All you have to do is initialize pointers to NULL when declared, e.g. [icode]int *ptr = NULL;[/icode] or set them to NULL in c++ class constructors. There is no such test for other kinds of variables. But you can either write your own or use an existing smart pointer …

Member Avatar for Ancient Dragon
0
7K
Member Avatar for KRUX17

Use a loop. There are three kinds of loops: for loop, while loop, and do loop. Use the one that best fits the situation. [URL="http://www.cprogramming.com/tutorial/lesson3.html"]Read this short tutorial[/URL]

Member Avatar for irre
0
212
Member Avatar for mrcerimo

>> for (int n=0;n<=99 ;) What makes you think there will be 99 characters in the string? You should use this: [icode]for(int n = 0; n < words.size(); )[/icode] Also not that you should use <, not <=

Member Avatar for mrcerimo
0
310
Member Avatar for ads1188

Are you using Windows Forms program? Or something else? General, make a public function in Form2 that Form1 can call and pass the data. Form1 will have to get a pointer to Form2 in order to do that. Another way is to put the data into a common data file …

Member Avatar for Ancient Dragon
0
105
Member Avatar for Z33shan

>>how can i access the variables of my "xyzView.cpp" file in the Dialog Box CDocument class contains a linked list of CView classes. So first you have to get a pointer to CWinApp by calling AFX::GetApp(), then from that pointer get a pointer to CDocument using its GetNextDocumenTemplate() method. Since …

Member Avatar for Ancient Dragon
0
396
Member Avatar for mombasageek

Torrents in and of themselves are no more illegal than any other program. Its how you use the torrent that can become a legal issue.

Member Avatar for Ancient Dragon
0
177
Member Avatar for salinajohnson

Maybe someday Dani will put that feature in PFO too. I'm getting tired of banning signature spammers.

Member Avatar for Ancient Dragon
0
222
Member Avatar for aderogba08

See [URL="http://www.daniweb.com/software-development/cpp/tutorials/90228"]this tutorial[/URL]

Member Avatar for aderogba08
0
227
Member Avatar for shadow29014

why aren't you just reading the data as integers instead of strings? It would be a lot simpler and you won't have to worry about spaces. I'd put the data into a 2d array of ints which would then be easy to sort.

Member Avatar for WaltP
0
227
Member Avatar for franmaez_0716

[URL="http://www.cplusplus.com/forum/general/8510/"]Here's a link [/URL]for MS-Windows (and it won't matter which 32-bit compiler you use. It won't work with Turbo C or Turbo C++)

Member Avatar for franmaez_0716
0
2K
Member Avatar for Z33shan

This [URL="http://msdn.microsoft.com/en-us/library/aa716527(v=vs.60).aspx"]Scribble tutorial[/URL] will show you how to draw lines with MFC

Member Avatar for Ancient Dragon
0
578
Member Avatar for onemanclapping

The program must know what operating system its running under because it has to be recompiled for each os. Add some sort of preprocessor directive that tells the program what os its being compiled for. For example, you might put the define _WIN32 in the makefile when compiled for MS-Windows …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for MrEARTHSHAcKER

google for "mixed language programming" and you will find quite a bit about that topic. Its easier to mix C with other languages than it is c++, but it can be done. C++ will probably need some C wrapper functions in order to mix them with other languages because of …

Member Avatar for mike_2000_17
0
275
Member Avatar for sharath_137

See [URL="http://groups.google.com/group/microsoft.public.vc.language/browse_thread/thread/5f415587010e7b8c"]this thread[/URL] for some hints

Member Avatar for Ancient Dragon
0
94
Member Avatar for mBrissman
Member Avatar for ads1188

You don't link the database itself, but a library of functions. There are at least two ways to do this: 1) ODBC -- see [URL="http://www.google.com/#hl=en&output=search&sclient=psy-ab&rlz=1C2CHFX_enUS452US455&q=odbc+tutorial+c%2B%2B&psj=1&oq=odbc+tutorial&aq=1&aqi=g5g-v5&aql=&gs_sm=1&gs_upl=2784l5527l0l8498l13l13l0l5l5l0l86l479l8l8l0&bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&fp=f0b85e3c6de8b9f9&biw=1616&bih=909"]this tutorial[/URL] 2) ADO -- [URL="http://www.google.com/#hl=en&output=search&sclient=psy-ab&rlz=1C2CHFX_enUS452US455&q=ado+tutorial&psj=1&oq=ado+tutorial&aq=0&aqi=g4g-v6&aql=&gs_sm=1&gs_upl=1168l3630l0l7058l12l12l0l5l5l0l95l421l7l7l0&bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&fp=f0b85e3c6de8b9f9&biw=1616&bih=909"]tutorials here[/URL] Both the above require a good deal of programming and require a good grasp of c or c++ languages. …

Member Avatar for ads1188
0
265
Member Avatar for prasenjit_das

Either vc++ 2010 or Code::blocks will work (assuming you are using MS-Windows). vi or Code::Blocks on *inx.

Member Avatar for Ancient Dragon
0
60
Member Avatar for tom12

If you are writing a c++ program why are you using c's gets() function instead of c++ cin or getline()? >>if (test[i]=='a' || test[i]=='e' || test[i]=='i' || test[i]=='o' || test[i]=='u' || test[i]=='A' || test[i]=='E' || test[i]=='I' || test[i]=='O' || test[i]=='U') { test[i]=' '; Probably easier to use a switch statement …

Member Avatar for Ancient Dragon
0
926

The End.