15,300 Posted Topics

Member Avatar for atramposch

If its a stack problem as ^^^ suggested you could also just allocate the array [icode]double* dblData = malloc(ARRAYSIZE * sizeof(double));[/icode]

Member Avatar for Ancient Dragon
0
169
Member Avatar for TSims11

Assuming this is an MS-Windows program you could put the settings in the registry, such as HKEY_CURRENT_USER/Software/<Your Program Name Here>. That way your program can get the settings regardless of where the program is on a computer.

Member Avatar for Ancient Dragon
0
111
Member Avatar for lochnessmonster

Which specific fuction are you talking about? win32 api functions normally return 0 if the function failed. >>is there any other way i can do this in a easier/better manner Write your own wrapper for the win32 api function that throws an exception, similar to the one that c++ new …

Member Avatar for Ancient Dragon
0
85
Member Avatar for Perry31
Member Avatar for Ancient Dragon
0
85
Member Avatar for tas10

You can't just skip over fields. Read the entire line then extract what you want from it and discard the rest.

Member Avatar for tas10
0
252
Member Avatar for Nemoticchigga

Nope, not me. What compiler and operating system. Its possible the lib you are attempting to use is 1) compiled by a different compiler, or 2) written for a different operating system, or 3) corrupt.

Member Avatar for thready
0
68
Member Avatar for pooja_singh

your class declarations are terrible! One-letter variable names is highly discouraged because they mean nothing to anyone except the original author, then he will forget what they mean after a couple days. I'd suggest starting by rewriting the classes to use more descriptive variable names. As for variable z? I …

Member Avatar for sai shiva j
0
1K
Member Avatar for cherrydeee

Have you tried [URL="http://lmgtfy.com/?q=graphics+for+assembly+language"]ths?[/URL] Your 16-bit assembly program can not call any of the win32 api graphics functions so you will have to bite the bullet and write it all yourself. I would suggest you get Turbo C graphics library and learn how to call those functions from your assembly …

Member Avatar for Goalatio
0
212
Member Avatar for TSims11

Whether you use Show() or ShowDialog() depends on whether you want a modeless or model dialog window. Below code works for model dialogs. First close Form1 then show Form2. After Form2 is closed you have to show Form1 to make it visible again. [code] private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) …

Member Avatar for TSims11
0
277
Member Avatar for Futchy

1. Don't try to do them all at the same time, but do them one at a time. Don't start on the second problem until you have finished the first. 2. Post the code that you have already written (and use code tags as [URL="http://www.daniweb.com/techtalkforums/announcement8-3.html"]explained here[/URL]) , tell us what …

Member Avatar for darkbreaker
0
416
Member Avatar for alviss_88

lines 8 and 9. Why are those loops counting from 0 to 10? Array em only contains 3 trings and array e contains 2 strings. line 17: array em does not contain a NULL pointer, so line 17 will do nothing. There are a couple ways to do what you …

Member Avatar for Perry31
0
306
Member Avatar for malayasthana

what compiler are you using? If you are using a 32-bit compiler then you can use win32 api functions FindFirstFile() and FindNextFile(). google for those functions and you will find example programs how to use them. But if you are using something like Turbo C then there may be no …

Member Avatar for Ancient Dragon
0
122
Member Avatar for vedel

>>How i can make a .o file? Use g++ compiler. The other alternative is to write your own compiler.

Member Avatar for Ancient Dragon
0
161
Member Avatar for elsiekins

>>sizeof(uint16_t) * 16 Wrong. All that gives you is the number of [b]bits[/b] (not bytes) in one integer. what you want is the size of one of the arrays, such as [icode]ARRAYSIZE*sizeof(uint16_t)[/icode] >> do i need to use strcpy No. strcpy() works on strings of text data, not numeric data.

Member Avatar for Ancient Dragon
0
125
Member Avatar for burcin erek

in square.h -- lines 13-17. You can't put executable code in header files like that. If the intent is to make them inline, then do it like you did on line 9, what is [icode]void set_values(int a) {x = a;};[/icode] square.cpp: delete conio.h and replace getch() with cin.get(). No point …

Member Avatar for alaa sam
0
138
Member Avatar for keeda

You can only read bytes, never bits :) Open the file in binary mode then use file.read() to read into a buffer of 1000 bytes [code] unsigned char buf[1000]; ifstream in("filename",ios::binary); in.read(buf,sizeof(buf)); [/code]

Member Avatar for chiwawa10
0
80
Member Avatar for bufospro

You can do this without reg expressions. Note: The code below was not compiled or tested. [code] #include <stdio.h> #include <string.h> int main() { char line[255]; char* ptr; FILE* fp = fopen("filename.txt","r"); while( fgets(fp,line,sizeof(line) != NULL) { ptr = strstr(line,"<From: "); if( ptr != NULL) { // got it, so …

Member Avatar for Ancient Dragon
0
81
Member Avatar for Obsidian_496

[URL="http://www.codeproject.com/KB/miscctrl/pgllib.aspx"]Here[/URL] is one way to do it. You might want to install VC++ 2010 Express or Code::Blocks instead of using Dev-C++.

Member Avatar for mike_2000_17
0
709
Member Avatar for biju127

filin was never opened. I always find it easier to use ifstream instead of fstream for input only strweams.

Member Avatar for biju127
0
217
Member Avatar for izzykel

>>char* anArray[] That parameter is a 2 dimensional array, what you are trying to pass is a single character. Now, down in main(), you declared [b]sortArray[/b] as a single-dimensional array. That means you can not put more than one string into it. Line 50 will only let you enter a …

Member Avatar for izzykel
0
1K
Member Avatar for user543820

What operating system are you using? TSRs are almost useless with MS-Windows

Member Avatar for Ancient Dragon
0
56
Member Avatar for newbyE

Works ok for me. Maybe there is something else wrong with the way your program is reading the file. Try this little program to see if it works with your text file. [code] #include<iostream> #include <fstream> #include<string> #pragma warning(disable: 4996) int main() { std::string line; std::ifstream in("TextFile1.txt"); while( getline(in,line) ) …

Member Avatar for newbyE
0
7K
Member Avatar for malayasthana

You can use resize() when you originally create the vector so that it will contain room for using [] to insert items [code] vector<int> ay; ay.resize(10); for(int i = 0; i < 10; i++) ay[i] = i; [/code] or you can use an iterator [code] int main() { int count …

Member Avatar for mike_2000_17
0
121
Member Avatar for serkan sendur

[URL="http://www.imdb.com/title/tt0031381/"]Gone With The Wind[/URL]. Great 1939 epic about the Old South (USA) Civil War and the mixed-up love between four people. The most commonly quoted line in US today is: Rhett Butler said "Frankly, my dear, I don't give a damn." Also anything directed by [URL="http://en.wikipedia.org/wiki/Cecil_B._DeMille"]Cecil B. DeMille[/URL]

Member Avatar for ronnieaka
0
1K
Member Avatar for muze

Don't use [b]std[/b] in c++ programs as std is the name of a namespace. You have to repeat the typedef statement in MyProjDlg.cpp [icode] typedef vector<LPTSTR> StudentData; extern StudentData stdData; [/icode]

Member Avatar for muze
0
1K
Member Avatar for florisvd

We won't write it for you, but help you with what you don't understand. What exactly don't you understand about the assignment? Have you even made an attempt to write the program? What compiler and operating system are you using?

Member Avatar for Ancient Dragon
0
210
Member Avatar for merse

How do you think 4/2 is represented in memory? If you use doubles it will be 2.0000... Similarily 4/3 is 1.3333... in memory. Its NOT just a string -- that is the binary representation. If you want to know how doubles are formatted in memory then you need to study …

Member Avatar for merse
0
237
Member Avatar for tfmontague

create a union [code] // declare types enum data_types { undefined_type = 0, bool_type, char_type, short_type, ushort_type, int_type, uint_type, // etc for each type you want to support }; struct data { data_types valid_type; union types { bool b; char c; short s; unsigned short us; int i; unsigned int …

Member Avatar for alwaysLearning0
0
192
Member Avatar for miha2

Before attempting to decrypt that you need to know the shift value, and whether it was shifted right or left. I suppose you could solve it by iterating through all 26 possible shift values ('A' - 'Z' = 1-26) assuming case is ignored.If not then there would be at least …

Member Avatar for miha2
0
745
Member Avatar for Duby

Welcome to DaniWeb -- glad to have you here. Almost never to old to get back to school and learn new skills or trades.

Member Avatar for WASDted
0
85
Member Avatar for merse

Sure -- if you know assembly language you can access the math coprocessor, but there's not much point in doing that because that'sa what C/C++ does anyway.

Member Avatar for mrnutty
-2
97
Member Avatar for Ultraviolet
Member Avatar for Ultraviolet
0
164
Member Avatar for MarounMaroun

[code] struct matrix* InitMatrix(int x, int y, int z) { struct matrix* m = malloc(sizeof(struct matrix)); // initialize the structures elements <snip> return m; } [/code] Free it in reverse orderof allocating it.

Member Avatar for Ancient Dragon
0
299
Member Avatar for achieve_goals

using '@' as a deliminator in getline() is not what you want to do anyway. To make a word counter use >> operator, not getline() [code] string input; int word_count = 0; while( cin >> input) { if( input == "@@@" }\ break; word_count++; } [/code]

Member Avatar for achieve_goals
0
341
Member Avatar for smeghead007

Please copy and paste the actual contents of the first few entries in the transction file so we can see what it really looks like. If there is a space between d or w and the value then reading the file should be easy and straight forward [code] char action; …

Member Avatar for smeghead007
0
340
Member Avatar for YellowJello

what I would do is this [code] class MyBasic { public: friend ostream& operator<<(ostream& out, const MyBasic& mb); friend istream& operator>>(istream& out, const MyBasic& mb); // other class stuff here } [/code] Then in the *.cpp file just create two overloaded functions that do not contain the [b]friend[/b] keyword.

Member Avatar for Ancient Dragon
0
190
Member Avatar for merse
Member Avatar for Ancient Dragon
0
95
Member Avatar for MichaelSammels

You will have to add a resource file to the project. [URL="http://www.thefreecountry.com/programming/resourceeditors.shtml"]Here[/URL] are some free resourc file compilers.

Member Avatar for mohanty_555
0
79
Member Avatar for DynamicMember

There is no such thing as Visual C++ 2o1o -- you probably mean Visual C++ 2010. If you want to program then you must know the difference between 'o' and '0' :) Use VC++ 2010 -- its newer and supports current c++ standards better. The last time I used Borland …

Member Avatar for DynamicMember
0
147
Member Avatar for Transcendent

What does the subject of pointers have to do with the subject of data structures? Other than a structure can contain pointers. [URL="http://daweidesigns.netfirms.com/cgi-bin/pointers.php"]Here [/URL]is an interesting article about pointers written by DaWei

Member Avatar for Ancient Dragon
0
305
Member Avatar for natostanco

Whether a byte is signed or unsigned, depends on how you want to treat it. Maybe you want to study [URL="http://stackoverflow.com/questions/247873/signed-versus-unsigned-integers"]this thread[/URL]. Whether the value of a byte in memory is teated as signed or unsigned all depends on the instruction you want to use. The value of the byte …

Member Avatar for natostanco
0
104
Member Avatar for qvyhnl

delete line 7 and move the return between lines 9 and 10. That else statement on line 7 is causing the function to return after the virst attempt to chedk the value of *s.

Member Avatar for Ancient Dragon
0
196
Member Avatar for aznlitomik3

lines 21 and 22. open() method takes const char*, not std::string. You have to use string's c_str() to make the conversion. [icode]input.open(inf.c_str());[/icode]

Member Avatar for Ancient Dragon
0
145
Member Avatar for qvyhnl

delete the loop on lines 4-7 because the dest buffer may contain some text that the program needs to keep. That loop destroys all that text. The first thing the function needs to do is find the end of the text, if any, that is in the dest buffer. [code] …

Member Avatar for Ancient Dragon
0
188
Member Avatar for MarounMaroun

>>why if I change AllocString(strlen(s), &copy); to AllocString(strlen(s)-7, &copy); I can still get a good result? AllocString() doesn't actually copy anything into the newly allocate memory but just returns a pointer to it. If you allocate fewer bytes than you try to copy into that memory the outcome will be …

Member Avatar for MarounMaroun
0
106
Member Avatar for z_a

>> wanted to edit and correct the post but can't figure out how. You only have 30 minutes to make changes. After that you are just SOL ("Sadly Outta Luck" (polite form) for anyone who doesn't know that that means). Your code snippet is in error. [icode]char a;[/icode] should be …

Member Avatar for z_a
0
455
Member Avatar for qvyhnl

line 10. The break is unnecessary because of the return statement on the previous line. line 9: wrong. You want [icode]return &s[i];[/icode] line 19: That will most likely display 0 if the function every returns NULL, which may not be what you intend. Otherwise your program looks good :)

Member Avatar for qvyhnl
0
106
Member Avatar for ntgsx92

>>strcpy(array1[n],array[i]); Just use simple assignment [icode]array1[n] = array[i];[/icode]

Member Avatar for ntgsx92
0
103
Member Avatar for mashhype

You need to post most recent code. If you want to just check for a single character than [icode]if( argv[1][0] == 'n')[/icode]

Member Avatar for mashhype
0
259
Member Avatar for Duby

There is a reverse() method in std <algorithm> header file [code] #include <string> #include <algorithm> #include <iostream> using namespace std; int main() { string name; cout << "Enter your name\n"; getline(cin,name); reverse(name.begin(),name.end()); cout << name << '\n'; } [/code]

Member Avatar for Ancient Dragon
0
190

The End.