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

Username:   Password: 
 RegisterRegister   
 Gr.12 bi-weekly questions
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
naoki




PostPosted: Fri Oct 03, 2003 12:31 am   Post subject: Gr.12 bi-weekly questions

this is prolly no use, but mebbe it will.
post your tips, syntax help and mebbe even a little code on the awesome questions that your ICS teacher decides to give you

hopefully this will take some stupid stress off the teacher, who dumps questions at us and then slips stupid hints in when we're trying to work.
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Fri Oct 03, 2003 11:31 am   Post subject: (No subject)

intresting idea but we are not going to do the questions for ya Razz

whould be cool of we could get a hole buch of questions and then post some hints and tips for each one. aslo will stop techers from using question from the same book over and over, lol
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
naoki




PostPosted: Fri Oct 03, 2003 7:38 pm   Post subject: (No subject)

hey that's not what i'm saying but it certainly would be a help
i can post this week's codes (7 i messed up on) to the questions on functions, tho i doubt anyone outside of massey might know what i'm talking about.

also is there an index function and possibly a way to use subtrings such as

put letter (1 .. 9) <-- turing obviously
AsianSensation




PostPosted: Sat Oct 04, 2003 9:53 am   Post subject: (No subject)

strstr search for a substring within a string, kinda like index in turing, it searches for the first occurance of the substring.

and i think to output a substring, a for loop should take care of that.

btw, the question given to us by our teacher was this: create a function, of type char*, that takes a string, and remove all the duplicate letters in that string. Memory must be allocated by the user (Actually, he worded it very weirdly, I think he meant that we were suppose to use new)
naoki




PostPosted: Sun Oct 05, 2003 1:52 pm   Post subject: (No subject)

he words a lot of things wrong: lessons, test questions, assignments, hand-in dates.

is <string.h> the only pre-processor command we should include?

Off-topic1: he said he'd be in his room after school so we could hand our programs in. he wasn't, room locked, lights off.

Off-topic2: in Friday's Foxtrot, that kid Jason has to write a message on the board 500 times. he uses C++ and writes out a program instead
code:
printf ("i will not curse");

funny stuff.
rizzix




PostPosted: Sun Oct 05, 2003 2:00 pm   Post subject: (No subject)

use JString makes life easier.
rizzix




PostPosted: Sun Oct 05, 2003 2:02 pm   Post subject: (No subject)

o nvm you wan't to find a substring inside a string.. funny thats the only thing i've left out in the class. Neutral
naoki




PostPosted: Sun Oct 19, 2003 2:42 pm   Post subject: (No subject)

how do you pass a structure to a function?

i want to make a functions that do different file i/o's to a structure, like sorting by file size. how would i pass a structure as a parameter?

an example would be most helpful
StrikerMagazine




PostPosted: Sat Oct 25, 2003 5:57 pm   Post subject: (No subject)

the same way you pass anything else to a function ^^

when integers are the parameters, your function prototype could like this:

code:
convert(int n1, int n2);


when structures are the parameters, it might look like this:

code:
convert(coordType n1,coordType n2);


where 'coordType' is a structure that you've defined. all of the variables declared under that structure are accessible through the parameters that were passed, i think.. like if 'x' and 'y' were declared under 'coordType' in the example, you would be able to refer to n1.x, n1.y, n2.x or n2.whatever ... ^^
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 1 of 1  [ 9 Posts ]
Jump to:   


Style:  
Search: