Showing results 1 to 29 of 29
Search took 0.01 seconds.
Posts Made By: wellibedamned
Forum: C++ Jun 23rd, 2008
Replies: 3
Views: 233
Posted By wellibedamned
Re: easiest way to find a slow loop?

hmmm, nice, thanks alot!! but hey...windows.h aint givin me that function in dev c++...is it the compiler?
Forum: C++ Jun 23rd, 2008
Replies: 3
Views: 233
Posted By wellibedamned
easiest way to find a slow loop?

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...
Forum: C++ Jun 10th, 2008
Replies: 3
Views: 343
Posted By wellibedamned
Re: C++ in Vista

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...
Forum: C++ Jun 9th, 2008
Replies: 8
Views: 486
Posted By wellibedamned
Re: sorting floats/ints inside an array of string

this is what i came up with...and it works fine
#include <iostream>
#include <string>

using namespace std;

int posd( string s ){ for( int i = 0; i < s.length(); i++ )if( s[i] == '.' )return i;...
Forum: C++ Jun 8th, 2008
Replies: 1
Views: 179
Posted By wellibedamned
lib. string type sizes and that stuff...

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...
Forum: C++ Jun 8th, 2008
Replies: 8
Views: 486
Posted By wellibedamned
Re: sorting floats/ints inside an array of string

hmm, ok, so the substr thing checks the string between two given indexes? cool, i'll use that more often, thanks :)
Forum: C++ Jun 8th, 2008
Replies: 8
Views: 486
Posted By wellibedamned
Re: sorting floats/ints inside an array of string

i get all but the substr() thing, but i'll look it up. my way of doing it was addind zeros to the front and the back of the strings until both are equal, then went through to check if they differ...
Forum: C++ Jun 8th, 2008
Replies: 8
Views: 486
Posted By wellibedamned
Re: sorting floats/ints inside an array of string

hmm, i've already tried this but atof makes the precision too low, therefor i don't swap two numbers that are different for example in the 100th digit after the floating point...
i need more...
Forum: C++ Jun 8th, 2008
Replies: 8
Views: 486
Posted By wellibedamned
sorting floats/ints inside an array of string

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...
Forum: C++ Jun 6th, 2008
Replies: 9
Views: 345
Posted By wellibedamned
Re: cstdio input?

hmm, i think i get the %g format. and i found out where my error was while doing the integer check. i was doing division on an integer and forgot that in c++ '/' gives integer results. i did a cast...
Forum: C++ Jun 6th, 2008
Replies: 9
Views: 345
Posted By wellibedamned
Re: cstdio input?

i want them printed as integers if they are, i want the printed with non zero significant digits...for example: input: 1.3 output: 1.3
Forum: C++ Jun 6th, 2008
Replies: 9
Views: 345
Posted By wellibedamned
Re: cstdio input?

umm, yea, another question came up... and again, i don't want to post a new thread.
i'm trying to do a float integer check, and it simply doesn't work.
i made a function like this:
bool isint( float...
Forum: C++ Jun 6th, 2008
Replies: 9
Views: 345
Posted By wellibedamned
Re: cstdio input?

#include <cstdio>
int main( void )
{
int h, m, s; double kh = 0, km = 0;
scanf( "%d%d%d", &h, &m, &s );
for( int i = 0; i < h; i++ )
kh += 30;
for( int i = 0; i < m; i++ )
...
Forum: C++ Jun 6th, 2008
Replies: 9
Views: 345
Posted By wellibedamned
Re: cstdio input?

hm yeah...the &s, thanks
i have another question, i just don't want to post a new thread...
i've already posted this question but now i'm asking...
"%.5g" prints an integer if there are no digits...
Forum: C++ Jun 6th, 2008
Replies: 9
Views: 345
Posted By wellibedamned
cstdio input?

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)...
Forum: C++ Jun 2nd, 2008
Replies: 1
Views: 154
Posted By wellibedamned
Array input styles?

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...
Forum: C++ May 29th, 2008
Replies: 8
Views: 391
Posted By wellibedamned
Re: Same Old Fibonacci numbers!

hmm, i guess it's the same thing as above, but i'm just allergic to iostream..
#include <cstdio>
int main(void)
{
int num, f = 1, s = 1, n;
scanf("%d", &num);

while(s <= num)
...
Forum: C++ May 26th, 2008
Replies: 6
Views: 674
Posted By wellibedamned
Re: Sick large number multiplication

i get it. i'm not trying to reinvent something that has been invented. I just think i should know how it works. Also, i'm not in the industry (no waaaaii), i'm in school. And i guess my teacher would...
Forum: C++ May 26th, 2008
Replies: 5
Views: 289
Posted By wellibedamned
Re: mixing floats and ints...(don't ban me please for being such a noob)

Yup, a string was what i thought, but i wondered if i could have an array of floats that i can print out as integers if they don't have fractional parts. and if i could print a float to the last...
Forum: C++ May 26th, 2008
Replies: 5
Views: 289
Posted By wellibedamned
mixing floats and ints...(don't ban me please for being such a noob)

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...
Forum: C++ May 26th, 2008
Replies: 6
Views: 674
Posted By wellibedamned
Re: Sick large number multiplication

Hmm, can't use that. Kinda can't use non standard cpp libs... I'll check it out anyways. What do you mean by reinventing the wheel?
Forum: C++ May 25th, 2008
Replies: 3
Views: 186
Posted By wellibedamned
Re: stuck

hmm, thanks alot people... i never really did typecasting.. works!
Forum: C++ May 25th, 2008
Replies: 3
Views: 186
Posted By wellibedamned
stuck

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.
#include <cstdio>
int...
Forum: C++ May 25th, 2008
Replies: 6
Views: 674
Posted By wellibedamned
Sick large number multiplication

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,...
Forum: C++ May 21st, 2008
Replies: 6
Views: 188
Posted By wellibedamned
Re: strtoking...

thanks!
that looks like an obvious solution now...
Forum: C++ May 21st, 2008
Replies: 6
Views: 188
Posted By wellibedamned
strtoking...

i'm trying to get the last word of the sentence using strtok.. i tried this :while (tok != NULL)
{
tok = strtok (NULL, " ");
if((tok != NULL) && (strtok(NULL, " ")==NULL))
...
Forum: C++ May 9th, 2008
Replies: 5
Views: 590
Posted By wellibedamned
Re: reversing the words from a sentence

umm, yeah, i use some stuff from my own language for the variable and function names...and i'm not too creative at doing that to be honest..:P
i made the space adding function cause it didn't print...
Forum: C++ May 9th, 2008
Replies: 5
Views: 590
Posted By wellibedamned
Re: reversing the words from a sentence

Umm, i finally came up with this, it's a result of my first idea of nulling... hope you people don't mind, i often mix c# and c++ cause i like the cstdio input.. this is the final thing, please post...
Forum: C++ May 9th, 2008
Replies: 5
Views: 590
Posted By wellibedamned
reversing the words from a sentence

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?)...
Showing results 1 to 29 of 29

 
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 6:25 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC