98 Posted Topics
Re: I would use modulo and div that is if I want to extract the second digit of 234 I would (234 %100)/10 The first paranthesis, strips out the 2 such that 34 remains this slash 10 then calulates how many timis 10 divides 34 without remainder. | |
Re: [QUOTE=s1986;823558] I gave it as urgent because of the lack of time in my hand.[/QUOTE] I can understand why you call it urgent, when it is urgent for you. But that doesn't make it urgent for me. I don't read every post on the boards I've signed up for, I … | |
Re: On a general note, (anyone correct me if I am wrong). The bool type is part of the c99 standard, and is as such not expected to be as portable. I've never found a use for the bool type that the short int or char couldn't solve. The bool still … | |
Re: I think you need to include cmath and or compile with -lm | |
Re: I wouldnt bother with the exponent. I would only use the coefficient and let the position in an "Array" be the exponent. Exponents are by definition integers >0 , so it should be ideally suited for a simple array. the polynomial [TEX]a Z^4 -b Z^3+cZ+7[/TEX] the last term has an … | |
Re: Hi i am the original poster from the other thread referenced to you. It's very difficult to get decent information, I have actually been reading a oldstyle book, to understand this. If you just want it to work do as stuxyz told me. On a deeper level, I think partial … | |
I'm having troubles linking together different classes that uses the same templated class. I found 2 workarounds, that will make it compile, but it's not really a solution. 1. don't do a staged compiling with linking object code 2. inlining the spezialized member functions. I'm looking for a solution that … | |
Re: [QUOTE=William Hemsworth;818427] If you can't do something like this, try using [URL="http://www.cplusplus.com/reference/clibrary/cstring/strtok.html"]strtok[/URL], it will help you split up the word using a delimiter. Hope this helps.[/QUOTE] Yes a tokenizer is highly recommended. You will end up using it in half you projects. | |
Re: you should try compiling each of the files into object code, something like g++ -c yourfile.cpp This should check if your compiler is workings, not the crosscompilation linker and all that stuff. To salem. you can compile headers, these are called .pch og h.gch stdafx on visual studio is an … | |
Re: Without having looked to much on your code, I would simply shadow the "numberofpayments" variabel in a greater scope, and print out the outputline after the main while loop | |
Re: So it's a minimum spanning tree right? if so use either kruskall or prim [url]http://www.boost.org/doc/libs/1_38_0/libs/graph/doc/index.html[/url] But don't bother with the implementation just use boost. | |
Re: I had a program where I need to read in data, I ended up tokenizing each line and looping while(!.eof()) | |
Re: [QUOTE=Mossiah;816401]Please help me with this. I am a newbie at this. I am supposed to pass a string array to a function. Letter grade Please give me an example on how to do it plz. thanks in advance.[/QUOTE] What do you mean, an array of strings? og just a string … | |
Hey, does anyone know if it possible to have something like [CODE] #DEFINE NUM_DEC 4 printf("This is your value:%.NUM_DECf\n"); [/CODE] thanks in advance | |
Hi, I've written a program for statistic analysis that can be found here [url]http://staff.pubhealth.ku.dk/~ande/web/software/relate.html[/url] I want to make it portable and the program works on unix with the following compilers sun, intel and gcc It also compiles on windows with mingw and the intel compiler. I've installed ms studio, but … | |
Hi, I was just wondering if adding debug symbols to my program, will slow down it's performance. I'm running linux. thanks in advance | |
Hi I'm trying to convert a linux/gcc program to windows/cl But I'm having some problems understanding the inner workings of the ide called microsoft visual studio c++ 2008 express. I've started a "new clr project", and then added the .hpp file, that contains the header. But the compiler/f7 says that … | |
Hi, I was thinking about implementing piping and redirection in some of my programs. But I'm having difficilties getting started. Does anyone know were to read up on this area, or just what to google. Google only gives my tutorials on basic unix commandline usage. thanks in advance | |
I've made a program using gcc as a compiler. In my loops I've been using a uint type as the type of my loop variable. But now it seems that some systems doesn't support this type. Can I make a preprocessor conditional that does a #define uint to unsigned int … | |
I wan't use the multimap on my own templated class. The following is a working example with a builtin type. [CODE=c++] int dat[5] = {0,6,3,7,3}; typedef std::multimap< int, int > asso; asso dict; for (int i=0;i<5;i++){ dict.insert(make_pair(dat[i],i)); } asso::iterator pos; for(pos=dict.begin(); pos!=dict.end() ;pos++) cout << pos->first <<" next "<< pos->second … | |
Re: Whats your error message? are you using namespace std otherwise string should be std::string | |
I've been overloading some methods for a template class. This means I can write my code in this way. [CODE=c++] myClass var3=var2+4; [/CODE] Is it possible to do it the otherway around like [CODE=c++] myClass var3=4+var2; [/CODE] I know that the end result will be the same, I was just … | |
Hi, I've been implementing my own array class, and I've finally started to use it. I do have one question, [CODE=c++] Array<int> ary1(3);ary1(0)=2;ary1(1)=4;ary1(2)=7; //just an array Array<int> ary2(3);ary2(0)=1;ary2(1)=2;ary2(2)=6; //just an array cout << ary1; cout << ary2; Array<int> ary3 = ary1+ary2; cout << ary3; //everything till this point works //is … | |
Hi I'm doing a templated matrix class, and I'd like to be able to pass a function pointer to a function that uses the rows. [CODE=c++] template<typename T> T sum(Array<T> &a){ // a simple function that return the sum of an Array T res=0; for(int i=0;i<a.length();i++) res+=a(i); return res; } … | |
I'm doing my own array template version of an array. I'm having some problems overloading a method. I'm doing a specifik version of a "print()" if the type of array is <char>,(i'm saving bools as char). this works without problems. I just needed to add a templete<> infront of my … | |
Re: I depends on the version of mpi, the scheduler and most of all how the admin has setup the system. If the admin is you, then you might have to setup a small script. I did the following when I installed mpi. my version of mpi used a list of … | |
Hi, I'm doing a low-mem implementation of a matrix, than can contain values from 0-4, this is fine for my program. I input 4 values (each 2bit) into 1 char(8bit). I'm using bitpatterns and shifting to extract values. But this is of cause hidden from the user. I've done everything … | |
Hi, I've been programming a lot of c code, and now I'm trying to set my mind into the c++ way of doing things. so I'm trying to avoid pointers, and use refs instead. As far as I understand pointers are to be avoided using stl's for instance. I have … | |
Re: [QUOTE=inkcoder;685742]Hey everyone, still learning c++ I had a question. How do I create an array that will hold strings of text. such as: ??? map[10]; map[1]= "text"; map[2] = "text2"; map[10] = "text3"; cout<< map[1] "\n"; help would be great ink[/QUOTE] You can do it in many different ways, but … |
The End.