Forum: C++
Yesterday, 10:00 AM
|
|
Replies: 4
Views: 84
|
Forum: C++
Yesterday, 12:43 AM
|
|
Replies: 11
Views: 123
Re: Reading a file?
After thinking about it I believe you are right. Variable first is not used as an index as it is in an array but as the value that was inserted into the map. Using negative values in a map is...
|
Forum: C++
Mar 11th, 2010, 11:37 PM
|
|
Replies: 11
Views: 123
Re: Reading a file?
Your code will not do that either.
Try replacing variable first with -1 and you will see why.
|
Forum: C
Mar 11th, 2010, 5:41 PM
|
|
Replies: 5
Views: 256
Re: Why there is a segmentation fault ?
You apparently wrote your program as a c++ program, not a C program. C programs have *.c extension. Change the file's extension to *.c and it will compile without the typecast.
|
Forum: Coder's Corner Lounge
Mar 11th, 2010, 11:15 AM
|
|
Replies: 1
Views: 45
|
Forum: C
Mar 11th, 2010, 11:10 AM
|
|
Replies: 5
Views: 97
|
Forum: C++
Mar 11th, 2010, 11:04 AM
|
|
Replies: 11
Views: 123
Re: Reading a file?
A slightly shorter way is like this, which will work as long as first is never negative and has no duplicates in the file.
int read_file(char * filename)
{
ifstream in(file_name);
if(...
|
Forum: C++
Mar 11th, 2010, 12:01 AM
|
|
Replies: 5
Views: 56
|
Forum: C++
Mar 10th, 2010, 11:42 AM
|
|
Replies: 5
Views: 56
|
Forum: C
Mar 10th, 2010, 10:59 AM
|
|
Replies: 2
Views: 74
Re: Font Size
read this thread (http://cboard.cprogramming.com/windows-programming/102187-console-font-size.html)
|
Forum: Community Introductions
Mar 9th, 2010, 10:07 PM
|
|
Replies: 2
Views: 164
|
Forum: C++
Mar 4th, 2010, 12:30 PM
|
|
Replies: 3
Views: 83
Re: assembler language
yes of course all c++ compilers do. Examle inline assembly for Microsoft compilers
int main()
{
int something;
_asm
{
mov [something],0
}
}
|
Forum: C++
Mar 4th, 2010, 9:46 AM
|
|
Replies: 3
Views: 83
|
Forum: C
Mar 3rd, 2010, 7:58 PM
|
|
Replies: 6
Views: 91
|
Forum: C++
Mar 2nd, 2010, 5:18 PM
|
|
Replies: 3
Views: 112
Re: check it plz
factorials become very large numbers very quickly, and int data type has only limited capacity, see limits.h for the maximum value that is possible for your compiler. You might want to use a 64-bit...
|
Forum: Assembly
Mar 2nd, 2010, 5:09 PM
|
|
Replies: 2
Views: 153
Re: x86 Pentium NASM lowercase to uppercase
Note that process_char is mostly coded wrong. In order to use the loop instruction you first have to set ecx (or cx) to the number of times the program needs to loop, such as the length of the...
|
Forum: C
Feb 28th, 2010, 11:48 AM
|
|
Replies: 6
Views: 290
Re: problem about dialog based win32 application
See the default case below.
LRESULT CALLBACK MyDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_INITDIALOG:
MessageBox(NULL, "Hello", "hello", MB_OK);
return...
|
Forum: C++
Feb 28th, 2010, 11:12 AM
|
|
Replies: 16
Views: 311
Re: morse code
In order to get the timings you have to resort to operating system specific API functions. For example on MS-Windows you could use clock() or maybe Query PerformanceFrequency()...
|
Forum: C++
Feb 27th, 2010, 10:31 AM
|
|
Replies: 6
Views: 158
|
Forum: C
Feb 27th, 2010, 9:18 AM
|
|
Replies: 9
Views: 150
Re: Parameters in main()
use Code::Blocks or VC++ 2008 Express, both are free and compile both C and C++ programs. Just google for them and you will find the download links.
|
Forum: C
Feb 27th, 2010, 9:12 AM
|
|
Replies: 11
Views: 221
Re: Problem with GNU GCC Compiler
lines 80, 85, 90, and 91. You can't stuff two characters into a char variable. '\b ' is two characters, not one.
After correcting the above, I get this output (vc++ 2008 express...
|
Forum: C++
Feb 26th, 2010, 11:51 PM
|
|
Replies: 16
Views: 311
Re: morse code
>>because i dont know how to start
Start here
int main()
{
// put your code here
}
|
Forum: C
Feb 26th, 2010, 12:44 PM
|
|
Replies: 9
Views: 150
Re: Parameters in main()
Surprise! You are using a very ancient compiler that may or may not work with modern operating systems. Download free version of Code::Blocks with MinGW compiler, or free VC++ 2008 Express and that...
|
Forum: C
Feb 25th, 2010, 11:56 PM
|
|
Replies: 9
Views: 150
|
Forum: Other Programming Languages
Feb 25th, 2010, 11:35 AM
|
|
Replies: 5
Views: 125
|
Forum: C
Feb 25th, 2010, 11:24 AM
|
|
Replies: 9
Views: 150
Re: Parameters in main()
All c compilers add some code to the beginning of the program that do some processing before main() is called. One of the jobs of that startup code is to create an array of strings that were the...
|
Forum: C
Feb 25th, 2010, 11:18 AM
|
|
Replies: 2
Views: 101
Re: Nth root program error
yor function sqrt() conflicts with the function sqrt() found in math.h. Name your function something else.
|
Forum: Python
Feb 25th, 2010, 7:55 AM
|
|
Replies: 5
Views: 7,710
|
Forum: C++
Feb 24th, 2010, 1:08 AM
|
|
Replies: 11
Views: 184
|
Forum: Assembly
Feb 23rd, 2010, 11:57 PM
|
|
Replies: 4
Views: 88
Re: Funny Question!
I wasn't talking about a huge program. Just write a tiny program with the instructions you want and see how they are assembled.
|
Forum: C++
Feb 23rd, 2010, 11:34 PM
|
|
Replies: 11
Views: 184
|
Forum: Community Introductions
Feb 23rd, 2010, 4:04 PM
|
|
Replies: 8
Views: 267
Re: Justin
It may not be a negative, but certainly not a valuable positive. It only helps if two candidates have equal experience but one has certifications and the other does not. Otherwise experience will...
|
Forum: Assembly
Feb 23rd, 2010, 2:30 PM
|
|
Replies: 4
Views: 88
Re: Funny Question!
I don't know the answer, but you can easily find out by running an assembler such as masm and see what it produces.
|
Forum: Coder's Corner Lounge
Feb 22nd, 2010, 11:26 PM
|
|
Replies: 1
Views: 91
Re: ADL and SQL
SQL is still quite relevant although its not a programming language.
COBRA is not a programming language but a library of functions that allow programs to do distributed processing (transfer data...
|
Forum: Community Announcements and Feedback
Feb 22nd, 2010, 7:50 PM
|
|
Replies: 31
Views: 2,232
Re: daniweb vs programmingforums?
Not so. Its called libel, not slander. Slander is for spoken words. Libel is written words. http://en.wikipedia.org/wiki/Defamation
|
Forum: C#
Feb 22nd, 2010, 1:02 PM
|
|
Replies: 2
Views: 101
|
Forum: C
Feb 22nd, 2010, 9:07 AM
|
|
Replies: 7
Views: 118
|
Forum: Community Introductions
Feb 22nd, 2010, 8:36 AM
|
|
Replies: 21
Views: 901
Re: Which language would you say to start?
If you want to make programming a career then you will have to learn several languages including, but not limited to, C, C++, Java, C++/CLR, C#, Python, HTML (and other related web scripting). Talk...
|
Forum: C
Feb 22nd, 2010, 8:31 AM
|
|
Replies: 7
Views: 118
|
Forum: Assembly
Feb 21st, 2010, 7:38 PM
|
|
Replies: 2
Views: 87
|