Go Back   nV News Forums > Software Forums > Software Development

Newegg Daily Deals

Reply
 
Thread Tools
Old 02-10-07, 01:16 AM   #13
Bman212121
Registered User
 
Join Date: Jan 2006
Posts: 6,726
Default Re: String Array in C

Gotta love homework. I need to get working on a program to do inventory. It is going to read in the info from the file into a few vectors (requirement), and allow you to search, and do a few other things with it. I'm writing it in C++, so it won't be as bad as what your doing, but C++ is kind of a pita IMO to do a lot of things I've done in VB .net. I guess I got too used to just creating a form, and programming buttons and textboxes to do their thing. Since this is beginner C++ were doing everything text based.
Bman212121 is offline   Reply With Quote
Old 02-10-07, 01:34 PM   #14
Tuork
Official pain in the ass
 
Tuork's Avatar
 
Join Date: May 2003
Location: 127.0.0.1
Posts: 1,197
Send a message via MSN to Tuork
Default Re: String Array in C

Quote:
Originally Posted by Imbroglio
basically you need to look at testtube's response

you need to memory allocate the size of the string you attempting to store, and be sure to release that memory after you are finished using it.

Aight.

Thanks.
__________________
My avatar: "An obscure and non sensical pattern made to get people to post what they think it is" - Vamp

Dimitri:
Dell XPS M1530
Core2Duo T5550 1.86Ghz | 3GB DDR2 | 8600M GT 256MB | 250GB Hdd | BenQ FP202W 20" LCD | MX1000 mouse | Inspire T5400 5.1
Tuork is offline   Reply With Quote
Old 02-10-07, 03:21 PM   #15
Subtestube
Anisymbolic
 
Subtestube's Avatar
 
Join Date: Aug 2004
Location: Wellington, New Zealand
Posts: 1,365
Default Re: String Array in C

Quote:
Originally Posted by Tuork
Aight.

Thanks.
If you've got any questions about memory allocation etc, feel free to ask, and I'll try to answer as best I can. I actually work predominantly in C++ these days, and as anyone who's migrated from C to C++ can tell you, avoiding direct malloc/realloc/calloc/etc...ing memory is probably one of the nicest things about the STL. Nevertheless, I've got a pretty good understanding of what's going on .

I will be away from my PC for most of today (it's Sunday and I'm currently on leave!), so if you don't get a really prompt reply from me, it's probably because I'm not actually online, rather than that I don't want to help.
__________________
Dr Possible: Core 2 Duo E6400 on Gigabyte GA-965P-DS4. Galaxy GeForce 7600GT. 2GB Corsair XMS 2 DDR2-6400 RAM (CL5). ATi Theatre 550 Pro. Windows XP MCE. All stored in Piano black Antec Sonata II, with a broken door.

Mobile: ASUS M2400N, Pentium M 1.5 GHz. 512 MB DDR RAM. Intel EXTREME graphics. Windows XP SP 2 / Ubuntu 5.10.

Ridiculous DOES not have an 'e' in it. It comes from "ridicule" and has less than nothing to do with the colour red.
Subtestube is offline   Reply With Quote
Old 02-13-07, 05:07 PM   #16
ViN86
 
Join Date: Mar 2004
Posts: 15,486
Default Re: String Array in C

Quote:
Originally Posted by Tuork
Aight.

Thanks.
yea you can get away with not inputting a size in most windows developer programs, but if youre coding from a text file in C, you need to declare the size of the array.

also, make sure you dont accidentally try to access an element outside the array, that will give you a nice crash (i speak from experience lol)

i wrote a program that plays a game of battleship and i wrote it in C. in the program, i deal with two dimensional arrays constantly throughout the file. if you want i can send you file. its nicely commented (i was graded on it) so it might help quite a bit. send me a pm if you want it, and ill email it to you
ViN86 is offline   Reply With Quote
Old 02-13-07, 08:50 PM   #17
Tuork
Official pain in the ass
 
Tuork's Avatar
 
Join Date: May 2003
Location: 127.0.0.1
Posts: 1,197
Send a message via MSN to Tuork
Default Re: String Array in C

Thank you all for all your input. you have been more than helpful.

Due to personal reasons (which I will comment on in the following days) I haven't had tiem to work on this. However, all I need to do now is add som fork()'s and I'm basically set. (All part of the assingment)
__________________
My avatar: "An obscure and non sensical pattern made to get people to post what they think it is" - Vamp

Dimitri:
Dell XPS M1530
Core2Duo T5550 1.86Ghz | 3GB DDR2 | 8600M GT 256MB | 250GB Hdd | BenQ FP202W 20" LCD | MX1000 mouse | Inspire T5400 5.1
Tuork is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pure Storage Launches Next Generation All-Flash Storage Array News Latest Tech And Game Headlines 0 06-11-12 09:40 PM
GL_EXT_texture_compression_s3tc support for Quadro4 700 XGL marvin24 NVIDIA Linux 3 08-20-03 09:00 AM
Major WineX prob... I think it has to do with the vidcard... Linewbie NVIDIA Linux 20 10-09-02 09:58 PM
TNT2 - DXTC/ S3TC extensions .. DarkYY NVIDIA Linux 19 10-01-02 12:31 PM
Xtacy t14600, Redhat 7.3.. X but no logo. Rob C. NVIDIA Linux 8 08-12-02 09:28 AM

All times are GMT -5. The time now is 01:20 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.