337 Posted Topics
Re: 1st use the indentation. [ code ] [ /code ] blocks. 2. Use a good indentation. oky your program should print the return message before returning. [code] //************************************************************* // Definition of factorial. A recursive function to calculate * // the factorial of the parameter n. * //************************************************************* int factorial(int n) … | |
Re: [QUOTE=arkoenig;1315883]The current C++ standard does not support threads, so you will either have to pick a nonstandard implementation or wait until the new standard is complete.[/QUOTE] Ya C++0x specification does support threads. There are google tech video that illustrating how to work with C++0x threads.Find it out. Let us know … | |
Re: [QUOTE=mike_2000_17;1316519][URL="http://linux.die.net/man/3/system"]system()[/URL][/QUOTE] using system() have lots of downsides.no offense but try reading. #man 3 setenv or online [url]http://www.manpagez.com/man/3/setenv/[/url] | |
Re: [QUOTE=^Y^ nobody ^Y^;1314986]How can i make the user input the "search" string ?? >> std::string search = "hate" ,str; << How to input this ?? thank you[/QUOTE] you mean read from user input? Use the std::cin for that. [code] #include <iostream> int main(int argc,char **argv) { std::string _input; std::cout <<"Please … | |
Re: [CODE]int s = b.Activate(std::const_cast<int&>(war.get_tp()), damage, 50);[/CODE] I do not recommended this code through my past C++ experience. Please note that this practice will lead to thousands of hidden semantic bugs that you can't even easily track. The best thing is create a new int and use it there.(and if this … | |
Re: if you are inside windows then you can use the registry to store that information. if you are in linux use the file /etc/<your-app-name>.conf and store that variable inside that file. | |
Re: [code] #include <iostream> int main(int argc,char**argv) { std::cout << "Hello World ! << std::endl; return 0; } [/code] google for Visual C++ sample programs, [url]http://lmgtfy.com/?q=visual+C%2B%2B+sample+programs[/url] | |
![]() | Re: do you need just the function to generate the random numbers or would you like to know how a rand() like function is working? |
Re: [QUOTE=Ancient Dragon;1307504]I have a custom user title too, because it's true that after 25+ years I'm still learning :) And I didn't like the default title -- too boastful.[/QUOTE] me too need a title like that. Because [COLOR="Red"]actually [/COLOR]I'm still learning. | |
Re: First of all your program should be corrected to this.It got compilation errors. [code] #include<iostream> using namespace std; const int hourConv = 3600; // used to get total hours from total seconds const int minConv = 60; struct MyTime { int hours, minutes, seconds; }; MyTime determineElapsedTime(MyTime const &time1, MyTime … | |
Re: Jar files are ran inside a sanbox security model. If it not coming with extra certifications and signatures.So don't worry too much in this case. Go ahead and install. but I can't grantee that.Even it's inside the security sandbox there are smart ppl in the world who can write exploits … | |
Re: >> Some compilers don't like it when the source file does not end with at least one empty line. See MSDN. yes just hit the enter at the last line and try again. If it doesn't work ,then you can clean all , restart the computer and try again building … | |
hi all, I'm new to the linux programming first of all. I just wrote this program. [code] #include <fcntl.h> #include <stdio.h> #include <iostream> #include <string> using namespace std ; int main(int argc,char **argv) { /* open the file */ string _path_name = "./file"; string _return ; int fd=open(_path_name.c_str() ,O_RDONLY); /* … | |
Re: >> There is the macro __LINE__ which gets replaced with the current line number, but it's an integer. that's the recommended way to do this.Your debugger done this using something called debug symbolic information.In other words it's a symbol , where it consists a tuple for each line in a … | |
Re: so mate you have to read the error messages one by one and fix the whole program.Believe me there's no another way. And use [ code ] [ / code ] tags ,because they are nice. | |
Re: Who gives you this homework ? I better email him. | |
Re: first please use the [ code ] and [ / code ] tags. The line [code] students[i]=Course.students[i]; [/code] contain an error.it should be like this. [code] Course::Course (string* students) { [B]this->students = new string[SIZE];[/B] for(int i=0; i<SIZE; i++) { [B]this->students[i]=students[i];[/B] } } [/code] you have to use this , and … | |
Re: mate please use code tags "[ code ]" and "[ / code ]" when you posting the source code. And your program seems to have lots of errors.Where are the semicolons after the end of the class declaration? And include should be like this [code] #include "A.h" [/code] too. Please … | |
Re: you can generate the diassembly and see that there's not a call instruction when you are using inline functions.I think that's the simplest way to do that. Or break inside a inline function and inspect the stack.You can find the difference when comparing the inline stack frames and non-inline stack-frames. … | |
Re: In syntatically: so you got the call stack you asking from us? Check your destructor , the error happens when it calls the destructor. In semantically: Why the hell it gives a access violation when it calls the destructor? :) well when in the line number 91 the there are … | |
Re: [QUOTE=VernonDozier;989009]I put in a lot of cout statements, like: [code] char c[3]; cout << "Got this far\n"; c[0] = 'H'; cout << "Now I'm this far! Cool.\n"; c[1] = 'e'; cout << "Hot damn! I'm this far\n"; c[2] = 'l'; cout << "Oh yeah! Stylin'. I'm here!\n"; c[3] = 'l'; … | |
Re: >> After several hours of placing more or less meaningful printing-commands around the code you don't need to do that, because gdb have a function called print. you just break on the line for example , from the code that I'm currently debugging. [code] 20 (gdb) continue Continuing. Breakpoint 2, … | |
Re: Another Explanation. sorry if re-post. pi is not a rational number which you can represent as 22/7.We just use it as an approximation. and there is no pattern of pi 's n th fraction. Even supercomputers have this limit. In the software and computer perspective it generates errors. Think about … | |
Re: may be this bellow code snippet help you to print out what is the error goes on actually. [code] MYSQL mysql; mysql_init(&mysql); mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"your_prog_name"); if (!mysql_real_connect(&mysql,"host","user","passwd","database",0,NULL,0)) { fprintf(stderr, "Failed to connect to database: Error: %s\n", mysql_error(&mysql)); } [/code] please note I caught that code from there.[url]http://dev.mysql.com/doc/refman/5.0/en/mysql-real-connect.html[/url] where the MySql API documentation … | |
hi, I am using mingw32-gcc-3.4.2 inside a windows XP Professional SP3 computer. For my project I uses libcomctrl32.a library.The compilation goes without an error. and linking too.But the problem is it crashed on the runtime.Then I add the -g option and debug it. Here is the stack trace that I've … | |
Re: so according to your scenario first decompose your scenario. Think your computer is an isolated black box and you reading that voltage using a port. Then the port is probably your serial port or the parallel port , if you have A2D converter . if not you can use the … | |
Re: [QUOTE=christina>you;321574]More men I bet... Most girls are not smart .. no offense to my gender.. but we're too interested in drama and painting our fingernails.[/QUOTE] when comparing brain skills , you need to go deepest into the brain and study the cotex more very deeply to find the difference between … | |
hi all , I am a newbie for the x86 and x64 assembly language. Correct me if I am wrong. 99% of the assembly language sources are revese engineered virus binary. So what acutally a newbie had to read is those. Except the realiaty that's the truth. These days I'm … | |
hi all, Let us all share the Interactive learning methods through the Internet. I mean the interactive learning methods that can be seriously useful and successful in self studying computer science.I'm a 3rd year student of here [url]http://www.bit.lk/[/url] and I decided to do self studying due to the higher fees … | |
Re: I think next human civilizations will do ! yes I completely agree with you. old days we had kings and kings are violating everyone's rights.But now we got the laws and human rights.Therefore we can say our human civilization is under construction (called evolution ). Next generations most probably reject … | |
everyone in the IT knows what is Foxc0nn , it's a assembly line for the apple iphone too as I heard. More than that it's a big assembly line. Do you ever wonder the life stories behind the assembly line? Or you just only brother your iPhone or Foxc0nn motherboard … | |
Re: In the programming languages like PHP or Java this function is constructed by using the `regex`.But I don't recomand to use regex because they not constant time algorithms.And yes there are regex libraries for C++ or even using a lex.using lex you can write your own parser. But let's go … ![]() | |
Re: you cannot delete a int. You can delete a pointer. But here you want to delete something from a vector. use the vector.erase(iterator position) method. [url]http://www.cplusplus.com/reference/stl/vector/erase/[/url] | |
Re: [QUOTE=firstPerson;1099866]I think I am one of few without a Facebook. Even my uncle has one.[/QUOTE] I haven't any physical friends believe me. So the only place that I have been finding friends is facebook. | |
hi all, I think I had done enough googling on this.But unable to get a proper explanation.Even there's not a wiki page exists there. So I need your help in advance. what is pre-rendering that coming with the AMD FUSION?I need to someone to explain it's architecture,and its ins and … | |
Re: The implementation details are totally offtopic here.But it worth to mention that here. Executable file normally contains a data section and that data section is splitted into several sub sections. 1. initialized data. 2. uninitialized data. 3. heap. source: [url]http://en.wikipedia.org/wiki/Data_segment[/url] so according to that wiki page , static variables can … | |
Re: you can use pcap library to write a one. [url]http://en.wikipedia.org/wiki/Pcap[/url] two semesters ago I had done a project related to this, under network programming. This may be those example samples that you looking for. [url]http://www.tcpdump.org/pcap.htm[/url] not sure precisely. Just I don't think I get your question precisely.anyway see around it … | |
Re: what does the assembler do is just convert the assembly language source file into a object file. file name ended with .a .obj .o like extension. I'm using nasm and suggest you too use it.With this command like you assembling it to a object file. [CODE] nasm -f elf HelloWorld.asm … | |
Re: according to the big bang theory , the old of universe is the radius of universe / light of speed in vacaum.anyway both parameaters are already calculated using hubble data. The theory says that space time is expansion , it's not a explosion, most accurately there is a explosion of … | |
Re: I voted for C++. cos we can found it in at most of every hardware/software plactform. and it's the most productive programming language. and I'm still learning C++. And C++ is very rich programming language because of the libraries that available for the developer at no cost ( open source). | |
I'm not trying to DoSing a wolframalpha web services or their asserts. but try this expression , click this link and say to slove ( clusters ) , http://www.wolframalpha.com/input?i=find+roots+2^x^785435432564-+48+%3D0 probably it will ever lasting and non terminating the calculation. Why is that ? anyone curious , how it works ? … | |
Re: [quote]im new to assembly and have an assembly project to convert arabic numbers[/quote] what type of assembly ? ia32 assembly ? x86assembly or other .... what is the software plactform ? linux , windows dos ? my suggestion is just download the free nasm or yasm assember for your plactform … | |
Re: if you not confident enough then what you have to do is: you remove the optmization of you're compiler and diassemble you're binary program and see , then you'll get more confident. Just use a olydebug like program or on visual C++ IDE there is a diassembly viewer that was … | |
Re: the default inheritance is private inheritance if you not explicitly mentioned. well private inheritance is more likely an has-a relationship than the is-a relationship. and the bottom line is use private inheritance where you can't avoid and use composition where every elsewhere. there are three object oriented concepts relate to … | |
Re: only for this question, [QUOTE]and how to view the contents of the symbol table.[/QUOTE] if you using the mingw tools or gcc or DJGPP like gcc based tools, you can use the nm utility to view the symbol table associated with each binary or object file. [code] nm mybinary.o [/code] … | |
Re: [QUOTE] c code to matlab code [/QUOTE] or matlab to C Code ? I don't think that there are automatic converters exists. But as you already know for matlab to C there are automated converters inside matlab package. [QUOTE] convert my C file to matlab (.m) file If you know … | |
Re: [CODE]dbList(int size=0,Node<Type>* head=0,Node<Type>* tail=0); [/CODE] it seems that you only declare that method. you have to implement it. | |
![]() | Re: just try this , if not worked reply back. [code=cpp] #include <windows.h> // hope you already did this ShowWindow( GetConsoleWindow(), SW_HIDE ); [/code] |
we have already known that there should be some initialization to work with the stl. To use that library. There are objects that there should be initialized before entering main. I think that I receive this run time SIGSEG due to that. So any idea ? I have use a … | |
Hi , these days I'm reading the brans kernel development tutorial. and doing it's particles. So last I find to had to read Intel 80386 programmers manual by intel. In section 2.6 Interrupts and Exceptions I asking a theoretical question here. They said Exceptions are synchronous and Interrupts are asynchronous. … |
The End.