Linux下的C++开发定义一个String的字符串

2015年04月21日 其他资源 18条评论 阅读10291次

Linux下的C++开发

Linux下的C++开发想要定义一个String的字符串

直接写string str = "hello"; 会出现下面这样的编译报错

error: 'string' was not declared in this scope

看到网上的方法加入下面的include也是出现了另外一个错误

#include<string.h>

error: 'string' does not name a type

不知道是神马原因,后来想到了用标准C中定义字符串的方法。

// to define a string in C++

char str[] = "xxxx";

如果有强迫症一定想要写string。。。的可以自定义一个类型。

typedef  char STRING[100];

后续使用时可以直接用STRING str = "hello";的写法。

C++新手就只写这样菜鸟的文章,随时记录随时更新。

分享本文至:

WRITTEN BY

avatar
本文标签:C++
看了本文是不是觉得很赞,那就赶紧点击下面按钮分享给身边的朋友吧!

18 条评论

  1. <a href="http://www.juliegranahan.com/femmes-nike-roshe-run-slip-noir-bleu-zapatosd">femmes nike roshe run slip noir bleu</a> <a href="http://www.kailuahotel.com/air-jordan-12-og-schwarz-varsity-rot-obuvl">air jordan 12 og schwarz varsity rot</a> <a href="http://www.boardbehavior.com/pandora-charm-prices-nz-today-pandorad">pandora charm prices nz today</a> <a href="http://www.rentalsmm.com/nike-free-sort-gr%C3%A5-trainersi">nike free sort gr氓</a> <a href="http://www.litugomez.com/herren-asics-gel-kinsei-5-wei%C3%9F-silber-chaussuresg">herren asics gel kinsei 5 wei脽 silber</a> <a href="http://www.lesperruques.com/ralph-lauren-aqua-blue-shirt-poloa">ralph lauren aqua blue shirt</a>
    sonsofmalcolm http://www.sonsofmalcolm.com/

  2. <a href="http://www.hkyahao.com/asics-dam%C3%A4nner-gel-kayano-21-wei%C3%9F-hot-rosa-emerald-rom-foota">asics dam盲nner gel kayano 21 wei脽 hot rosa emerald rom</a> <a href="http://www.innordicau.com/air-jordan-jumpman-h-plata-oro-runningd">air jordan jumpman h plata oro</a> <a href="http://www.rahdanesh.com/limited-customized-mens-jersey-tampa-bay-buccaneers-team-road-two-tone-nfl-nflh">limited customized mens jersey tampa bay buccaneers team road two tone nfl</a> <a href="http://www.myprontocard.com/nike-blazer-hi-suede-rojo-zapatosh">nike blazer hi suede rojo</a> <a href="http://www.eldiadeitalia.com/nike-roshe-run-barn-kaffe-scarpea">nike roshe run barn kaffe</a> <a href="http://www.lapakhoki.com/orlando-magic-new-era-nba-on-court-collection-9twenty-cap-hati">orlando magic new era nba on court collection 9twenty cap</a>
    ibigwig http://www.ibigwig.com/

  3. <a href="http://www.cardiachits.com/womens-coach-messenger-bag-coachh">womens coach messenger bag</a> <a href="http://www.zestchannel.com/adidas-soccers-shoes-silver-black-shoesj">adidas soccers shoes silver black</a> <a href="http://www.eczacinim.com/kvinders-nike-zoom-structure-18-gr%C3%A5-sort-skol">kvinders nike zoom structure 18 gr氓 sort</a> <a href="http://www.chilangorails.com/adidas-neo-leisure-noir-vert-chaussuresq">adidas neo leisure noir vert</a> <a href="http://www.mariusen.com/femmes-nike-shox-deliver-rose-oranger-chaussuresl">femmes nike shox deliver rose oranger</a> <a href="http://www.brittonoilco.com/adidas-neo-mesh-gold-grau-schuhei">adidas neo mesh gold grau</a>
    thefarmergirl http://www.thefarmergirl.com/

  4. <a href="http://www.dvdlivedoor.com/air-jordan-jumpman-h-negro-oro-scarpea">air jordan jumpman h negro oro</a> <a href="http://www.exterminas.com/florida-state-seminoles-top-of-the-world-ncaa-ploom-adjustable-cap-hati">florida state seminoles top of the world ncaa ploom adjustable cap</a> <a href="http://www.filoliteafarm.com/nike-lunarglide-6-kvinders-gr%C3%A5-guld-trainersb">nike lunarglide 6 kvinders gr氓 guld</a> <a href="http://www.shalandaleigh.com/nike-air-max-90-fl%C3%A5den-bl%C3%A5-top-kurpesd">nike air max 90 fl氓den bl氓 top</a> <a href="http://www.skepticmoment.com/nike-air-max-90-hyp-frm-frau-grau-lila-schuhel">nike air max 90 hyp frm frau grau lila</a> <a href="http://www.kleankampsite.com/femmes-air-jordan-retro-2-vert-rouge-skof">femmes air jordan retro 2 vert rouge</a>
    cvpekerjaan http://www.cvpekerjaan.com/

  5. <a href="http://www.dansdelas.com/salomon-s-lab-sense-nero-girl-kurpese">salomon s lab sense nero girl</a> <a href="http://www.laurenrouppas.com/nike-lunarglide-nero-and-oro-obuva">nike lunarglide nero and oro</a> <a href="http://www.evameade.com/nike-air-max-95-360-sort-anthracite-hvid-sport-r%C3%B8d-obuvf">nike air max 95 360 sort anthracite hvid sport r酶d</a> <a href="http://www.imageaveinc.com/yeezy-boost-750-gr%C3%A5-gum-mat-obuvf">yeezy boost 750 gr氓 gum mat</a> <a href="http://www.ncaquascape.com/nike-roshe-run-marine-junior-schuhef">nike roshe run marine junior</a> <a href="http://www.htgsingapore.com/air-jordan-1-low-svart-hvit-kurpesd">air jordan 1 low svart hvit</a>
    hshuixin http://www.hshuixin.com/

  6. <a href="http://www.matkailuvarkaus.net/nike-internationalist-utility-negro-ops-2-obuvd">nike internationalist utility negro ops 2</a> <a href="http://www.medmanage.net/nike-shox-deliver-gull-brun-chaussuresa">nike shox deliver gull brun</a> <a href="http://www.medsample.net/nike-air-huarache-ni%C3%B1os-butya">nike air huarache ni帽os</a> <a href="http://www.metacommunities.net/adidas-tubular-runner-west-naranja-verde-scarpef">adidas tubular runner west naranja verde</a> <a href="http://www.metalinquisition.net/maschio-nike-free-5.0-verde-oro-butyf">maschio nike free 5.0 verde oro</a> <a href="http://www.michigangolfguide.net/adidas-protator-2014-cijena-butyf">adidas protator 2014 cijena</a>
    siragon http://www.siragon.net/

  7. <a href="http://www.doctid.com/nike-tanjun-junior-blanc-chaussures-schuhef">nike tanjun junior blanc chaussures</a> <a href="http://www.dhanakaryam.com/asics-hombres-gel-kayano-21-lite-amarillo-negro-nike-scarpee">asics hombres gel kayano 21 lite amarillo negro nike</a> <a href="http://www.djmattconsola.com/nike-lebron-9-low-fireberry-for-salg-kurpesa">nike lebron 9 low fireberry for salg</a> <a href="http://www.chinchout.com/nike-free-5.0-v4-schwarz-wei%C3%9F-schwarz-kurpesc">nike free 5.0 v4 schwarz wei脽 schwarz</a> <a href="http://www.mccrarycabins.com/air-jordan-retro-13-bambini-blu-nero-obuva">air jordan retro 13 bambini blu nero</a> <a href="http://www.javajoeshhi.com/nike-zoom-ascention-p%C3%BArpura-gris-schuhef">nike zoom ascention p煤rpura gris</a>
    duboismantels http://www.duboismantels.com/

  8. avatar prmadvantage

    <a href="http://www.arcellphones.com/stefan-janoski-max-gris-acheter-scarpee">stefan janoski max gris acheter</a> <a href="http://www.autimispc.com/air-jordan-7-retro-mineral-bleu-quilt-runningg">air jordan 7 retro mineral bleu quilt</a> <a href="http://www.kevingoersch.com/nike-hypervenom-phelon-2-tf-footballe-rosa-gelb-schwarz-schuhei">nike hypervenom phelon 2 tf footballe rosa gelb schwarz</a> <a href="http://www.bursakirmizi.com/baylor-bears-nike-ncaa-vapor-sideline-coaches-cap-hath">baylor bears nike ncaa vapor sideline coaches cap</a> <a href="http://www.kudusbilinci.com/air-jordan-6-retro-low-negro-mettodasic-plata-qs-trainersce">air jordan 6 retro low negro mettodasic plata qs</a> <a href="http://www.pocketrats.com/herren-converse-wei%C3%9F-low-tops-schuhek">herren converse wei脽 low tops</a>
    prmadvantage http://www.prmadvantage.com/

  9. avatar hzrdcraft

    <a href="http://www.swingergroup.com/adidas-damian-lillard-2-schwarz-wei%C3%9F-schuhel">adidas damian lillard 2 schwarz wei脽</a> <a href="http://www.bluelakebooks.com/asics-gel-noosa-tri-8-corriendo-zapatos-mujeres-top-skoe">asics gel noosa tri 8 corriendo zapatos mujeres top</a> <a href="http://www.lideresworld.com/femminile-nike-kobe-9-low-blu-grigio-footg">femminile nike kobe 9 low blu grigio</a> <a href="http://www.navixstream.com/femminile-air-jordan-retro-14-tutti-oro-sneakerd">femminile air jordan retro 14 tutti oro</a> <a href="http://www.clarinblogs.com/nike-hyperrev-2015-verde-bianca-schuhee">nike hyperrev 2015 verde bianca</a> <a href="http://www.telecomcierge.com/nike-air-max-1-ultra-moire-neutral-gr%C3%A5-footf">nike air max 1 ultra moire neutral gr氓</a>
    hzrdcraft http://www.hzrdcraft.com/

  10. avatar dmvantalya

    <a href="http://www.poppiesdelray.com/frau-nike-air-max-2016-schwarz-blau-wei%C3%9F-schuhei">frau nike air max 2016 schwarz blau wei脽</a> <a href="http://www.soundsofbuzz.com/nike-air-max-2016-svart-gr%C3%A5-obuvj">nike air max 2016 svart gr氓</a> <a href="http://www.hozloli.com/adidas-15.1-ic-arancia-scarpel">adidas 15.1 ic arancia</a> <a href="http://www.privetaustria.com/hommes-asics-gel-lyte-v-5-volcano-burgundy-rouge-rose-chaussuresh">hommes asics gel lyte v 5 volcano burgundy rouge rose</a> <a href="http://www.goodnnasty.com/nike-huarache-ultra-blu-grigio-scarpeh">nike huarache ultra blu grigio</a> <a href="http://www.ankarasanal.com/nike-odell-beckham-jersey-nfli">nike odell beckham jersey</a>
    dmvantalya http://www.dmvantalya.com/

  11. avatar zestchannel

    <a href="http://www.unefinemouche.com/mujeres-air-max-90-hyperfuse-oro-rojo-zapatosk">mujeres air max 90 hyperfuse oro rojo</a> <a href="http://www.ayuinc.com/nike-kyrie-3-grey-gold-shoesi">nike kyrie 3 grey gold</a> <a href="http://www.unirlisboa.com/air-jordan-retro-6-gr%C3%BCn-brot-schuhei">air jordan retro 6 gr眉n brot</a> <a href="http://www.escortfeeds.com/nike-air-max-95-mujeres-blanco-verde-zapatosp">nike air max 95 mujeres blanco verde</a> <a href="http://www.rdjanitorial.com/nike-lunar-force-1-high-r%C3%B8d-skoi">nike lunar force 1 high r酶d</a> <a href="http://www.bookoobeats.com/nike-air-max-tailwind-8-kvinners-oransje-gul-obuvq">nike air max tailwind 8 kvinners oransje gul</a>
    zestchannel http://www.zestchannel.com/

  12. avatar lovemescort

    <a href="http://www.hutchinsmedia.com/odell-beckham-jr-college-jersey-nfli">odell beckham jr college jersey</a> <a href="http://www.datesfordate.com/converse-all-star-r%C3%B8d-obuvk">converse all star r酶d</a> <a href="http://www.spchemtech.com/coach-leather-crossbody-bag-sale-coachh">coach leather crossbody bag sale</a> <a href="http://www.eadamattia.com/nike-stefan-janoski-nero-pelle-scarpej">nike stefan janoski nero pelle</a> <a href="http://www.citypixxel.com/nike-kobe-ad-nero-oro-scarpei">nike kobe ad nero oro</a> <a href="http://www.megasatinc.com/washington-capitals-reebok-nhl-2nd-season-flex-cap-hath">washington capitals reebok nhl 2nd season flex cap</a>
    lovemescort http://www.lovemescort.com/

  13. avatar dientedeperro

    <a href="http://www.danielbroman.com/nike-hyperdunk-2014-r%C3%B8d-lyser%C3%B8d-scarpea">nike hyperdunk 2014 r酶d lyser酶d</a> <a href="http://www.integrityphx.com/baltimore-orioles-new-era-mlb-leisure-39thirty-cap-hati">baltimore orioles new era mlb leisure 39thirty cap</a> <a href="http://www.onthecar.com/adidas-neo-skate-azul-blanco-trainersb">adidas neo skate azul blanco</a> <a href="http://www.sallysoldit.com/air-max-2014-herre-sort-kurpesd">air max 2014 herre sort</a> <a href="http://www.hairsalonlush.com/nike-dunk-high-sb-schwarz-gum-schuhel">nike dunk high sb schwarz gum</a> <a href="http://www.robverheulen.com/nike-kobe-10-flyknit-low-lows-for-vente-skof">nike kobe 10 flyknit low lows for vente</a>
    dientedeperro http://www.dientedeperro.com/

  14. avatar michiganev

    <a href="http://www.townyplay.com/dam%C3%A4nner-converse-schwarz-alle-star-oxford-mono-trainers-schuhek">dam盲nner converse schwarz alle star oxford mono trainers</a> <a href="http://www.djpunjabii.com/demarcus-cousins-throwback-jersey-nflh">demarcus cousins throwback jersey</a> <a href="http://www.avsomurie.com/adidas-tubular-triple-svart-doom-obuvi">adidas tubular triple svart doom</a> <a href="http://www.circusveil.com/nike-mercurial-superfly-v-fg-grey-green-black-shoesj">nike mercurial superfly v fg grey green black</a> <a href="http://www.laconiaoil.com/pink-ladies-converse-shoes-shoesl">pink ladies converse shoes</a> <a href="http://www.hurizmir.com/polo-ralph-lauren-blue-polo-shirt-poloh">polo ralph lauren blue polo shirt</a>
    michiganev http://www.michiganev.com/

  15. avatar pleinairjourney

    <a href="http://www.matkailuvarkaus.net/nike-air-force-1-duckboot-gr%C3%BCn-schuhed">nike air force 1 duckboot gr眉n</a> <a href="http://www.medmanage.net/air-jordan-retro-30-grigio-rosa-butye">air jordan retro 30 grigio rosa</a> <a href="http://www.medsample.net/jordan-3-hvid-gr%C3%A5-obuvd">jordan 3 hvid gr氓</a> <a href="http://www.metacommunities.net/nike-air-max-tailwind-6-vivid-bleu-color-obuvg">nike air max tailwind 6 vivid bleu color</a> <a href="http://www.metalinquisition.net/jordan-retro-3-sandals-sort-schuhef">jordan retro 3 sandals sort</a> <a href="http://www.michigangolfguide.net/free-flyknit-4.0-corriendo-zapatos-obuve">free flyknit 4.0 corriendo zapatos</a>
    pleinairjourney http://www.pleinairjourney.net/

  16. avatar keleric

    <a href="http://www.unefinemouche.com/nike-free-inneva-woven-sp-night-stadium-wolf-grigio-scarpeh">nike free inneva woven sp night stadium wolf grigio</a> <a href="http://www.ayuinc.com/nike-air-max-90-premium-gituttio-verde-scarpei">nike air max 90 premium gituttio verde</a> <a href="http://www.unirlisboa.com/air-jordan-retro-6-dam%C3%A4nner-blau-himmelblau-schuheh">air jordan retro 6 dam盲nner blau himmelblau</a> <a href="http://www.escortfeeds.com/womens-nike-dunk-orange-blue-shoesq">womens nike dunk orange blue</a> <a href="http://www.rdjanitorial.com/america-jersey-2015-third-green-o-peralta-sambueza-soccer-jersey-14-15-nfli">america jersey 2015 third green o peralta sambueza soccer jersey 14 15</a> <a href="http://www.bookoobeats.com/mennns-asics-asics-gel-kinsei-2-rosa-gul-obuvp">mennns asics asics gel kinsei 2 rosa gul</a>
    keleric http://www.keleric.com/

  17. avatar doctid

    <a href="http://www.facenextday.com/dam%C3%A4nner-nike-kyrie-1-rosa-orange-kurpesb">dam盲nner nike kyrie 1 rosa orange</a> <a href="http://www.mellowsblues.com/nike-free-flyknit-chukka-p%C3%BArpura-amarillo-schuhee">nike free flyknit chukka p煤rpura amarillo</a> <a href="http://www.stackdotnet.com/herre-nike-free-flyknit-5.0-sort-guld-butyd">herre nike free flyknit 5.0 sort guld</a> <a href="http://www.donatelia.com/nike-kaishi-lightweight-sneaker-kvinders-gul-obuvc">nike kaishi lightweight sneaker kvinders gul</a> <a href="http://www.jafcosupply.com/jordan-11-low-gray-armada-scarpee">jordan 11 low gray armada</a> <a href="http://www.kanaldtvizle.com/air-jordan-retro-8-blanco-p%C3%BArpura-obuvd">air jordan retro 8 blanco p煤rpura</a>
    [url=http://www.doctid.com/]doctid[/url]

  18. avatar meknesmorocco

    <a href="http://www.sidecisions.com/adidas-ultra-boost-st-herre-hvid-chaussuresd">adidas ultra boost st herre hvid</a> <a href="http://www.htmlpast.com/nike-sb-royal-blu-nero-obuve">nike sb royal blu nero</a> <a href="http://www.djdikkethomas.com/nike-air-max-zero-femminile-nero-arancia-kurpesd">nike air max zero femminile nero arancia</a> <a href="http://www.dumpthatdebt.com/new-blance-620-b%C3%B8rn-hvid-orange-schuhec">new blance 620 b酶rn hvid orange</a> <a href="http://www.syderagencys.com/nike-hyperdunk-violet-or-butyg">nike hyperdunk violet or</a> <a href="http://www.atvhdizle.com/roshe-run-flyknit-negro-midnight-scarped">roshe run flyknit negro midnight</a>
    meknesmorocco http://www.meknesmorocco.com/

欢迎留言




用户登录

sitemap