No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
15 Posted Topics
Re: i heared concrete mathematics by knuth is good too | |
Re: depends on what you want to do really... it's easy to implement an adjacency list graph using the STL vector class, if you don't insist on making a special class for it ofc.. [CODE] vector< int > graph[ MAX_NODES ]; // graph[x] => neighbors of node x [/CODE] if you … | |
heya.. i wanted to ask if there was a way to give a pointer to a multidimensional array of, say, ints, as a function argument. i tried a somewhat natural approach, which seems to have failed.. i'm no expert at stuff like that, so i tried: [CODE] int numbers[ 10 … | |
Hmm, i kinda aint in the mood to dig the net about this, so i guessed i'd post my question here.. I'm not so familiar with the time library...is there a nice easy way to drop some code into the loops to check which one is slowing down the program? … | |
Re: i haven't used vista really, but it does have the normal cmd prompt, right? i'd try forcing it by invoking the MS compiler with C:\yourfolder> cl -GX yoursource.cpp gotta have ms visual studio stuff i think though. i tried this with empress some time ago but i've got dev so … | |
okay, this one's supposed to take n numbers, ints/floats, sort them, spit them out... now i have my code, and it looks fine to me, i'm doing bubblesort while checking with a bool function is the first larger than the second string... if i use two numbers, it works fine … | |
is there a way to "resize" a lib. string? is there a way to limit/set its size to a value? umm, and yeh, is there a better algorithm to search for all substrings in a string than this one i've made: [CODE] for( int i = 0; i < s.length(); … | |
i'm having problems reading with scanf... i'm trying to input some coordinates enclosed in brackets but it kinda skips the input that way... is it forbidden to say scanf( "(%d,%d) (%d,%d) (%d,%d) (%d,%d)", x1, yo, x2, y2, x3, y3, x4, y4 );? i'm using yo instead of y1 cause cmath … | |
Is there a nice function or a way of inputing values into an array until newline? i kinda don't like doing it with gets(); and then check if index%2 is 0 and then if it is i store the int(); value of the char - 48 into a new array. … | |
Re: hmm, i guess it's the same thing as above, but i'm just allergic to iostream.. [CODE]#include <cstdio> int main(void) { int num, f = 1, s = 1, n; scanf("%d", &num); while(s <= num) { n = f+s; f = s; s = n; } printf("%d", f); scanf("\n"); return 0; … | |
okay, i know i might be boring with my questions but could someone tell me how can i read an array of floats mixed with ints and then print them out same as they were on input...? typecasting thing again? anyone knows a good book i could use to stop … | |
Okay, so i have an idea...that looks like it should work. I'm supposed to be able to multiply for example: 1234567812345678912345678*1234562345673456. My idea was to put each number into a string, and then make a matrix to store the values of each digit multiplied by each digit... i'll put an … ![]() | |
could someone please check this code and tell me where i went wrong... it always gives the result 1.00000 but as you can see in the for loop it shouldn't be like that. [CODE]#include <cstdio> int main(void) { int n; float s = 0; scanf("%d", &n); for(int i = 1; … | |
i'm trying to get the last word of the sentence using strtok.. i tried this :[CODE]while (tok != NULL) { tok = strtok (NULL, " "); if((tok != NULL) && (strtok(NULL, " ")==NULL)) printf("%s", tok); }[/CODE] kinda doesn't work... anyone knows why? Yes, tok is a char * pointer.. | |
okays... so i'm looking for some kind of a standard algorithm that doesn't take long. i thought going backwards, finding the first space, writing the last word and nulling (is that even possible?) each char, but that doesn't really sound good to me. I've seen some people say you should … |
The End.