dobbleextra Posted January 4, 2016 Share Posted January 4, 2016 Sveiki! Šodien kodēju un uzskrēju uz problēmas, ar kuru pagaidām netieku galā. C++ funkcija var izsaukt tikai funkciju, kura ir deklarēta pirms tās, bet ja nu 1. funkcija izsauc 2., bet 2. noteiktā gādījumā atkal 1. Vai ir kāds veids kā šo apiet? Link to comment Share on other sites More sharing options...
eddyboi Posted January 4, 2016 Share Posted January 4, 2016 (edited) Uzrakstiju funkciju cita klasē, nezinu kā ir C++ bez C# tā var izdarīt, un tad koda augšā raksti include savaklase. http://stackoverflow.com/questions/17260009/adding-class-to-c-project Edited January 4, 2016 by eddyboi Link to comment Share on other sites More sharing options...
dobbleextra Posted January 4, 2016 Author Share Posted January 4, 2016 Jā, paldies. Tik tikko tieši pats to atcerējos, cik smieklīga kļūda. Vēlreiz paldies! Link to comment Share on other sites More sharing options...
AndrisBB Posted January 4, 2016 Share Posted January 4, 2016 Vai ir kāds veids kā šo apiet? Veids kā to apiet ir uzrakstīt funkcijas prototipus pirms tam, kas būtībā notiek ievietojot header failus Definējot prototipus tu pasaki kompilatoram ka būs tāda funkcija2() un viņš var nokompilēt kodu nezinot ko tieši viņa dara. // Funkciju prototipi void funncija1(); void funkcija2(); void funkcija1() { funkcija2(); } void funkcija2() { // koautko dara } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now