arkadaşlar fonksiyon class dışındayken gayet güzel çalışıyor fakat class içine aldığımda return valuesini yanlış diye error veriyor hemen erroru yapıştırıyım Error 1 error C2440: 'return' : cannot convert from 'SDL_Surface *' to 'SDL_Surface GraphicHandler::* ' 2 IntelliSense: return value type does not match the function type c:\Users\efee\Documents\Visual Studio 2012\Projects\Project4\Project4\GraphicHandler.cpp class GraphicHandler { public: static const int SCREEN_WIDTH = 640; static const int SCREEN_HEIGHT = 480; static const int SCREEN_BPP = 32; SDL_Surface *load_image( std::string filename ); void apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination ); void DrawBackground(); void UpdateScreen(); void start(); GraphicHandler(void); ~GraphicHandler(void); private: SDL_Rect s1; SDL_Rect s2; SDL_Surface *message; SDL_Surface *background; SDL_Surface *screen; }; SDL_Surface GraphicHandler::*load_image( std::string filename ) { //Temporary storage for the image that's loaded SDL_Surface* loadedImage = NULL; //The optimized image that will be used SDL_Surface* optimizedImage = NULL; //Load the image loadedImage = SDL_LoadBMP( filename.c_str() ); //If nothing went wrong in loading the image if( loadedImage != NULL ) { //Create an optimized image optimizedImage = SDL_DisplayFormat( loadedImage ); //Free the old image SDL_FreeSurface( loadedImage ); } //Return the optimized image return optimizedImage; } optimizedimagenin altı kırmızı :( |
arkadaşlar google amca yardım edemedi tüm yabancı kaynakları taratırrdım ama tık yok local databaseye nasıl bağlantı yapıp odbc connection yapabilirim en son şöyle birşey buldum fakat failed veriyor :( SQLHENV env; SQLHDBC dbc; SQLHSTMT stmt; SQLRETURN ret; SQLSMALLINT columns; int row = 0; /* Allocate an environment handle */ SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env); /* We want ODBC 3 support */ SQLSetEnvAttr(env, SQL_ATTR_ODBC_VERSION, (void *) SQL_OV_ODBC3, 0); /* Allocate a connection handle */ SQLAllocHandle(SQL_HANDLE_DBC, env, &dbc); /* Connect to the DSN */ SQLDriverConnectW(dbc, NULL, L"DRIVER={SQL Server};SERVER=(local)\DB1;DATABASE=library;UID=sa;PWD=password;", SQL_NTS, NULL, 0, NULL, SQL_DRIVER_COMPLETE); /* Check for success */ if(SQL_SUCCESS!=SQLAllocHandle(SQL_HANDLE_STMT, dbc, &stmt)) { std::cout << "Failed to connect"; } |
arkadaşlar cin ile kullanamıyorum ; person.gender daki cin kısmındaki >> in altı çizili ve no operator ">>" matches these operands diyor struct Person { enum Gender { Male,Female }gender; int IDNUM; string Name; int Age; int Height; string Profession; }; void PersonData (Person &person) { Person person; cout << "Please Enter the following details of the Person: " << endl; cout << "Name: "; cin >> person.Name; cout << "Age: "; cin >> person.Age; cout << "Height (in cm): "; cin >> person.Height; cout << "Gender: "; cin >> person.gender; //The Error is on this line. It also persists if I use getline cout << "Profession: "; getline (cin,person.Profession);; } |
arkadaşlar bi oyuna trainer yapıyorumda. elimde statik adres ve off set in hex hali ve 10 luk hali mevcut 2 sini topluyorum hex türünede çeviriyorum fakat okuttururken nası yapacağımı bilemedim. char buffer [33]; itoa ((value+offset),buffer,16); cout << buffer << endl; output u atıyorum 02df9084 veriyor.bu pointerın değerini nasıl okutturabilirim ? |
Merhaba arkadaşlar böyle bir konu eskiden açılmış fakat sahibi sınırsız ban yemiş bende konuyu yeniden açmaya karar verdim. 3 Ay önce spora başladım ve 3 ayın sonunda bir gün şiddetli bel ağrısı çektim,sakatlamışımdır felan geçer dedim fakat geçmedi 1 ay sonra doktora gittim röntgen çekti ve bel açıklığı çıktı.Doğuştan gelen birşeymiş.Anneninin gebelik halinde yeterli folik asit alamaması bu hastalığı tetikleyen en önemli unsurmuş.Doktor bir takım egzersizler verdi henüz başlamadım.Sizinde böyle rahatsızlığınız varsa burda sohbete başlıyalım :). |
https://projecteuler.net/problem=35 The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97. How many circular primes are there below one million? arkadaşlar 197 nin all rotations are themselves prime diyor fakat ben 197 den 917 de üretirim fakat 917 asal değil ? soruyu mu yanlış anlıyorum anlamama yardım edecek varmıdır? |
char efe[25]={"123213123213"}; arkadaşlar cout << efe[0] yazdığımda 1 i veriyor fakat cout << efe[0]*5 ; dediğimde 5 vermesi gerekirken 245 veriyor nasıl aşabilirim bu olayı? |
Arkadaşlar yaklaşık 10 denemeden 1 inde sonsuz döngüye giriyor sebebini bulabilcek var mı? #include "stdafx.h" #include <iostream> #include <ctime> using namespace std; void create() { srand((unsigned)time(0)); int seq[3][3],dizi[9],var,cou=0; dizi[0]= rand() % 10; dizi[1] = dizi[0]; bool result=false; for(int i=2;i<9;i++) { //randomly appoint numbers inside array do { do { var = rand() % 10; cou=0; for(int c=0;c<9;c++) { if(dizi[c]==var) { cou++; } } }while(cou!=0); dizi= var; }while(dizi==NULL); } for(int i=0;i<3;i++) { for(int x=0;x<3;x++) { do { result=false; var = rand() % 9; if(dizi[var]!=NULL) { seq[x] = dizi[var]; dizi[var]=NULL; result=true; } }while(result==false); } } for(int i=0;i<3;i++) { for(int x=0;x<3;x++) { cout << seq[x] << "|"; } cout << endl ; } } int main() { create(); system("pause"); return 0; } |
< Resime gitmek için tıklayın >
< Resime gitmek için tıklayın >