Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 c++ String HEEEELP!!!
Index -> Programming, C++ -> C++ Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
UBC_Wiskatos




PostPosted: Sun Jul 06, 2003 8:37 pm   Post subject: (No subject)

Homer_simpson wrote:
i'm sure as hell that strcat(s, "r"); is just what i want but for some friggin reason the exe file that's being made wont run.. i get some critical error crap... could some1 try
code:
#include <iostream>
#include <stdio.h>
#include <conio.h>

using namespace std;

int main()
{
        char* ch;
        ch="home";
        strcat(ch, "r");
        cout << ch<<endl;
        return 0;
}

on their compiler and see if it works or not... thx...
Quote:
i'm a mod now dude Wink

i already know that... but i dont think that mods are aloud to give free bits to them selves.. are they? Wink


Look at my example above, it shows you how to do it. I think your pointer stuff is messing your compiler up, it's tricky because you're adding one more character to the space in memory, and it's not as simple as just adding it (you need to reallocate memory and whatnot). What you need to do is make a char of a fixed size that can hold the size of the original string, plus the new string, that'll work.
Sponsor
Sponsor
Sponsor
sponsor
Homer_simpson




PostPosted: Sun Jul 06, 2003 11:36 pm   Post subject: (No subject)

aaaahhh...
strcpy and strcat were all i needed thanx man.. here have some bits =Þ...
+50 bits to UBC_Wiskatos
Homer_simpson




PostPosted: Sun Jul 06, 2003 11:51 pm   Post subject: (No subject)

ok here's another question... is there a command that will turn an integer or a float to a string...?
SilverSprite




PostPosted: Sun Jul 06, 2003 11:53 pm   Post subject: (No subject)

yes for chars its atoi and the related functions and you can also use sprintf
Homer_simpson




PostPosted: Mon Jul 07, 2003 12:05 am   Post subject: (No subject)

and the correct answer is..........sprintf..
silversprite is the winner... have some bits boy Razz Razz Razz
+20 bits to silver
ty for your helps ppl...
UBC_Wiskatos




PostPosted: Mon Jul 07, 2003 12:21 am   Post subject: (No subject)

Homer_simpson wrote:
aaaahhh...
strcpy and strcat were all i needed thanx man.. here have some bits =Þ...
+50 bits to UBC_Wiskatos


No prob! Smile
SilverSprite




PostPosted: Mon Jul 07, 2003 4:01 am   Post subject: (No subject)

so why is it that i only have one circle on my name?? how do you get more?? by posting?? or by the more bits you have??
krishon




PostPosted: Mon Jul 07, 2003 8:43 am   Post subject: (No subject)

wut circle??
Sponsor
Sponsor
Sponsor
sponsor
Homer_simpson




PostPosted: Mon Jul 07, 2003 1:24 pm   Post subject: (No subject)

I get more circles... cuz i'm a programming god!!! read my name title 8)
AsianSensation




PostPosted: Mon Jul 07, 2003 1:35 pm   Post subject: (No subject)

SilverSprite wrote:
so why is it that i only have one circle on my name?? how do you get more?? by posting?? or by the more bits you have??


it's something wrong with the site, dan is trying to fix it though.

and your status is suppose to change as you post more, i think right now you should be a NewBe Hacker.

but it gets frozen somehow....and doesn't change....

well, im assuming the changes are going to be made once the new compsci.ca comes out.....assuming they will release info on that....
Tony




PostPosted: Mon Jul 07, 2003 2:42 pm   Post subject: (No subject)

your rank gets frozen if you have title effects for your rank... Confused

its messed, lets just wait and see how v2 of the site will turn out.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
rizzix




PostPosted: Mon Jul 07, 2003 3:26 pm   Post subject: (No subject)

man i think dan has a lot on his shoulders,,
if we could only lessen the load for him... Confused
Mazer




PostPosted: Mon Jul 07, 2003 5:33 pm   Post subject: (No subject)

rizzix wrote:
man i think dan has a lot on his shoulders,,
if we could only lessen the load for him... Confused


chop off his shoulders? Confused
that'd surely lessen the load... everything would fall off! but somehow i get the idea that it could cause more problems in the long run.
SilverSprite




PostPosted: Mon Jul 07, 2003 6:15 pm   Post subject: (No subject)

hahahaha... oh wait..not very funny.. Razz
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 29 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: