15,300 Posted Topics

Member Avatar for Jon182

if you are using MS-Windows, create a shortcut then change the shortcut's icon.

Member Avatar for Jon182
0
137
Member Avatar for Acidburn

RW[h] is just the h'th character in the array -- strcpy wants a pointer to a character array. make a character pointer as shown below -- assuming h is the index into the array where you want to copy the string. [code] strcpy([color=red]&[/color]RW[h],"if"); [/code]

Member Avatar for Acidburn
0
130
Member Avatar for pietromele

The second option (with pointer) will be most efficient and fastest because the first option makes a copy of the object before putting it into the vector while the second one does not. And depending on the contents of class C the first option can be very very slow. The …

Member Avatar for Ancient Dragon
0
117
Member Avatar for rasheed1982

yes. use a while loop and iterate through the array until the desired value is found or the loop counter reaches the maximum value of the array.

Member Avatar for rasheed1982
0
100
Member Avatar for michika

[QUOTE=michika]hi.. just want to ask if <fstream> is really needed in making a program for round robin scheduler? im currently taking my os class and our project is to make a code for RR.. :?:[/QUOTE] fstream is not needed unless you want to save the data to a file on …

Member Avatar for michika
0
99
Member Avatar for sosy2001

what errors are you getting? I see a couple of missing semicolons -- your compiler should complain about them. Look at the errors, then look at your code and see if you can figure out what's wrong.

Member Avatar for Nedals
0
169
Member Avatar for JoBe

Since you want to spend your money, buy Pro edition. The Express is FREE -- you can't buy it.

Member Avatar for jwenting
0
125
Member Avatar for rajuwani121

you can't access most databases, such as Microsoft Access, SQL Server, MySql, Orical, etc, with that old 16-bit Turbo C compiler. You will have to upgrade to a modern 32-bit compiler, such as Dev-C++. Then you have several options, the oldest is ODBC. google for ODBC and you will find …

Member Avatar for jwenting
0
206
Member Avatar for muthuivs

Depends on operating system. If you are using MS-Windows, you can use win32 api function CopyFile() -- see MSDN for details. To my limited knowledge of *nix, I don't think *nix compilers have a similary function. You might also check the Boost libraries to see if it has a portable …

Member Avatar for iamthwee
0
135
Member Avatar for taha umar
Re: hi

[QUOTE=sunnypalsingh]A [b]string[/b] is any finite sequence of characters (i.e., letters, numerals, symbols and punctuation marks).[/QUOTE] There are two types of strings -- C and C++. A c-style string is a [b]null-terminated[/b] sequence of characters -- certainly considerably less than infinite! That means that the string ends with the first byte …

Member Avatar for ITgeneration
0
332
Member Avatar for Acidburn

did you delete the debug and/or release directories before you zipped of those files? And what compiler/version did you use?

Member Avatar for Acidburn
0
379
Member Avatar for chaitanya.b

[QUOTE=chaitanya.b] swap the string with out using any library functions [/QUOTE] you will have to 1. create a temporary buffer large enough to hold the longest string. 2. write your own strcpy() function -- but name it something else to avoid confusion with standard C function. 3. Then use the …

Member Avatar for Ancient Dragon
0
148
Member Avatar for muthuivs

you can't contantinate C style character arrays like that. Create a third buffer that is _MAX_PATH bytes long (if you are using MS-Windows os, I don't know what it is on *nix), then use sprintf() to create the string. Remember the format string uses "%s" for strings and "%d" for …

Member Avatar for muthuivs
0
970
Member Avatar for SkyFlyer1312

>>return (a + b + c) / 2; should divide by 3, not 2. I see no ambiguity in the average template -- all parameters are of type T and the caller cannot pass the first as int, the second as float and the third as double. All three must …

Member Avatar for Ancient Dragon
0
160
Member Avatar for sosy2001

now create the switch statement -- its easier than an if-then-else statement [code] switch(num) { case 1: cout << "one" << endl; break; case 2: // you can figure out the rest } [/code]

Member Avatar for sosy2001
0
145
Member Avatar for ilikerps

you don't need strcpy() at all [code] char sendBuffer[5]; char ch; // assume code in between makes ch something sendBuff[0] = ch; sendBuff[1] = 0; [/code]

Member Avatar for ilikerps
0
159
Member Avatar for Micko
Member Avatar for mydadisadentist

Wolfpack's program works ok with Dev-C++ too. I have version 4.9.9.2, but some previous versions should work too.

Member Avatar for mydadisadentist
0
702
Member Avatar for YoTaMiX

use qsort, std::sort(), or some other sort algorithm to sort the array normally then just print the values out in the desired order.

Member Avatar for YoTaMiX
0
1K
Member Avatar for aminura

no, but [URL=http://www.google.com/search?hl=en&q=how+to+convert+int+to+binary+in+C&btnG=Google+Search]Google[/URL] is a good place to find out how to do it. :D

Member Avatar for Narue
0
317
Member Avatar for atrusmre

[QUOTE=atrusmre]Is there a way to make a MFC application have Network capibilities without using windows sockets? [/QUOTE] No. winsock is Microsoft's implementation of Berkley Sockets which is the standard socket library in *nix os.

Member Avatar for calcop
0
148
Member Avatar for drock9975

look in the CDocument-derived class for your project -- it contains a skelletin of Serialize() function that you have to compilete (make it actually do something useful). This is where you read/write the data that you want saved to a file, database, socket connection, or anywhere you wish.

Member Avatar for Ancient Dragon
0
133
Member Avatar for ilikerps

ThreadMessages() must be a static method of the c++ class or a global function outside any class. I prefer using CreateThread() because it does not require linking to special multi-threading libraries like _beginthread().

Member Avatar for ilikerps
0
214
Member Avatar for wigster84

you can use strtok() -- warning, that function changes the string, so if you need the original string later in the program you will have to make a copy of it before calling strtok() the first time. [code] std::string str = "48098, 50933, 3128, 323, 42, 5"; int n; char* …

Member Avatar for Lerner
0
111
Member Avatar for ilikerps
Member Avatar for winbatch

you might have some other problem. This works ok for me [code] #include <iostream> using namespace std; void foo(const long& l) { cout << l << endl; } void foo(const bool& l) { cout << l << endl; } int main(int argc, char* argv[]) { bool b = true; foo(b); …

Member Avatar for winbatch
0
1K
Member Avatar for beuls

[quote]what modifications shd i do[/quote] A complete (or nearly complete) rewrite. There could be a port of graphics.h to win32, but I have't heard of any. google around a little to see what you can find there.

Member Avatar for beuls
0
225
Member Avatar for Nedals

This is normal c++ stuff and has nothing at all to do with MFC, other than MFC is also c++. When you put static keyword in the .h file that is making it global with the namespace of the class in which it is defined. So your compiler is producing …

Member Avatar for Nedals
0
257
Member Avatar for calcop

since you didn't post any code we can only guess. sysName is apparently NOT declared in any of the header files that are included in server.cpp. user the extern keyword like below. [code] // includes.h [b]extern [/b] char sysName[32]; [/code]

Member Avatar for calcop
0
181
Member Avatar for shortLived

[URL=http://www.codeguru.com/forum/showthread.php?t=317174&highlight=round+float]Here[/URL] is another way to round (maybe) the internal representation of a float.

Member Avatar for Ancient Dragon
0
148
Member Avatar for masa

make the column number a variable so that you can change it as desired. [code] int col = 7; for(int i = 0; i < col; i++) [/code]

Member Avatar for masa
0
226
Member Avatar for biggymacdaddy13

yes -- [code] vector<string> names; // // assumes there are more than 4 names in the vector sort(names.begin()+1, names.end()-2); [/code]

Member Avatar for Ancient Dragon
0
62
Member Avatar for red

API (Application Program Inerface) allows your program to access operating system functions, or functions in a library that may have been written by someone else. For example, the functions sleep(1000), a *nix API function, and Sleep(1000), a MS-Windows function (note spelling capatilization differences). They may be implemented in either a …

Member Avatar for Ancient Dragon
0
167
Member Avatar for zenoen

please edit your post and enclose the code in code tags. I hope the original program contains proper indentations so you can read it. [ code ] // code here [ /code ] remove spaces from above.

Member Avatar for zenoen
0
303
Member Avatar for red

Those are non-standard C functions that are defined in conio.h. Because they are non-standard, they may not be supported by all compilers (I think Dev-C++ supports them)

Member Avatar for red
0
151
Member Avatar for server_crash

might be your compiler -- mine (VC++ 6.0) prints -133. what compiler are you using?

Member Avatar for server_crash
0
188
Member Avatar for mybrainhurts

it does nothing because the function is never called anywhere. And why not use std::string for the file names instead of C style character arrays? If you are writing c++ then use c++ as much as possible. And you should use getline() for entering filenames so that the path and …

Member Avatar for Ancient Dragon
0
249
Member Avatar for DotNetUser

I would probably make a duplicate copy of the string, convert it to all upper (or lower) case. Then instead of using the Replace method you show, find the position of the first occurrence of "<BR>" then replace it in both copies of the string. I don't have enough experience …

Member Avatar for DotNetUser
0
201
Member Avatar for Jon182

saying something is part of the standard c++ library doesn't mean it is declared in <stdlib> -- and there is no such header file. you probably mean <cstdlib>, which was derived form C language. getline() is a method of std::string class and (I think) iostream. [code] #include <iostream> #include <string> …

Member Avatar for Ancient Dragon
0
369
Member Avatar for CPL85

first you need to declare an array of integers that represent the count for each characters -- since there are 26 letters in the English alphabet ('a' - 'z]) you will need an array of 26 integers. [code] int counters[26] = {0}; [/code] The abover declared the array and initialized …

Member Avatar for CPL85
0
86
Member Avatar for masa

rewind() does nothing more than seek to the beginnng of file. In C you can accomplish the same thing with fseek() function. In C++ fstream use seekg(0,ios_base::beg) or seekp(0,ios_base::beg)

Member Avatar for masa
0
130
Member Avatar for JoBe

yes, it can be similated in C with structures. Its not [b]quite[/b] the same concept as inherentence, but pretty close. And c++ class methods are not tied to any specific instance of a class -- they are more like static c++ methods. [code] struct Lightwave { // blabla } struct …

Member Avatar for Ancient Dragon
0
139
Member Avatar for masa

It is not necessary to actually store the data in a vector or some other array. Just keep track of the min and max values as the data is read from the file.

Member Avatar for masa
0
202
Member Avatar for gmv

[QUOTE=gmv]Hi, Thank you very much for your reply. i did use Sleep(20) but it doens't seem to work. Is there a wrong or a right way to do it? i am also wondering if the sleep fnc c? gmv[/QUOTE] What makes you think it doesn't work? 20 milliseconds is not …

Member Avatar for Dave Sinkula
0
239
Member Avatar for Ahzraei
Member Avatar for Aldin

why didn't you answer it? Its not that difficult. If you know what today is, then just use sprintf() to format the filename [code] int day_of_month = 10; char filename[255]; sprintf(filename,"day_%02d.txt", day_of_month); [/code]

Member Avatar for masa
0
463
Member Avatar for iamlearning

you can use that macro anywhere you use a string literal. You can't, however, use that macro with a char* [code] // this will NOT work char* hello = "Hello World"; wchar_t thello = UNICODE(hello); [/code]

Member Avatar for Rashakil Fol
0
191
Member Avatar for mariposa104
Member Avatar for iamlearning
0
254
Member Avatar for bops

if the file isn't too big, stat() will return its size, among other file info. you don't have to open the file to use it.

Member Avatar for Ancient Dragon
0
544
Member Avatar for osean

I don't know about CreateRemoteThread -- never used it. you probably won't find any "tutorials" because there isn't that much to it. Most of the parameters are 0, unless you want more control over the thread. First create the thread itself -- name it anything you want. If it is …

Member Avatar for osean
0
565

The End.