dear friends, I am a beginner in c programming and I have learned the c++, java as well, In C I have been asked for a question about how to convert lower case string like any name into uppercase, and i have read a program for it by pointers and I wanna do it by using typecasting and ascii values for characters so if anyone can help me on that.

Member Avatar
Member Avatar
+0 forum 4

I am trying to make a program that generates source code for a much larger program for simple reversal encryption. I don't know what I am doing wrong. Here is my code so far: #include<stdio.h> int main() { FILE *fp; fp=fopen("d:\\crypt.h", "w"); fprintf(fp, "char out[8];char cur[8]; char con[255,255,255,255,255,255,255,255];/n if cur==con out==0,0,0,0,0,0,0,0;/n while(cur <= con) /n con=con-1/n if cur>=con out=out+1; "); return 0; } please help, thank you

Member Avatar
Member Avatar
+0 forum 2

Dear All, I have written a code to implement an algorithm for base conversion from decimal to any base between 2 and 36 given in RG Dromey. Below is my code and I have a few questions relating to it: [CODE] #include<stdio.h> #include<stdlib.h> int main() { int newbase,zero=atoi(0),q,ndigit=0,r,ascii,i; char newrep[100]; printf("Enter number and base(between 0 and 36) to be converted"); scanf("%d%d",&q,&newbase); while(q!=0) { r=q%newbase; ndigit+=1; ascii=zero+r; if(ascii>atoi(9)) { ascii=ascii+7; } newrep[ndigit]=(char)ascii; q=q/newbase; } for(i=ndigit;i<=1;i++) { printf("%d",newrep[ndigit]); } system("pause"); return 0; } [/CODE] 1. Why is there a need for reverse conversion to characters of the ascii value after conversion before …

Member Avatar
Member Avatar
+0 forum 6

i am having problem in type casting,the result of the following code is giving -64, however it should be 192, why this is so? [CODE] #include <iostream> using namespace std; int main() { int a; a=char (192); cout<<a; return 0; } [/CODE]

Member Avatar
Member Avatar
+0 forum 1

Hi, I have inherited a project from a colleague and have an intersting problem. The project attempts to deserialize a type 'Client' into a new 'Client'. [CODE] Client mainClient = null; using ( stream = File.Open(resourceFilePath, FileMode.Open)) { BinaryFormatter bin = new BinaryFormatter(); mainClient = (Client)bin.Deserialize(stream); } [/CODE] this throws the error "Unable to cast object of type 'Admin.Client' to type 'Client.Client'. " I've read that deserializing via assemmblies (which this does) can lead to the objects being identified as completely different even if they are the same. Having had no experience at all with this I was wondering if …

Member Avatar
Member Avatar
+0 forum 1

Hello! Im having a problem with the following code structure. The code compiles without problems but when i start the program i get an "exception: __non_rtti_object at memory location...". In the constructor of the model-class i still can get the object information of the node-class through the base pointer. Once the construction of the model-object is completed the class information somehow got lost. I would be very grateful if somebody could point the problem out. Thanks! [CODE] #ifndef PATH_H #define PATH_H template<class T> class Path { private: T* lastPathComponent; Path(const Path<T>&); Path<T>& operator=(const Path<T>& rv); public: Path(const T& singlePath) { …

Member Avatar
Member Avatar
+0 forum 3

Okay, I'm making a shooter game, and all my weapons are differnt userdefined objects; ie. the flamethrower works differently then the gun, however, I'm calling some functions in my "main", an example of this would be; [CODE] /* <Init> */ MachineGunClass *CurrentWeapon; MachineGunClass *MachineGun; MachineGun = new MachineGunClass(); CurrentWeapon = MachineGun; /* </Init> */ /* <Usage> */ /* Lots of code */ CurrentWeapon->Shoot(); /*More code */ /* </Usage> */ [/CODE] So this works as it should, however let's say I wanted to use my flamethrower, to change to that weapon I would call the following; [CODE] FlameThrowerClass *FlameThrower; FlameThrower = …

Member Avatar
Member Avatar
+0 forum 8

[B]This has been solved! Look at the end of this post.[/B] Hello! I'm having some trouble here with polymorphism, as I need to access methods in a subclass from an array of superclass objects. This method is called parseCommand(Command c); The method exists in the superclass and is overridden in the subclasses. I'm using a LinkedList<Entity> with all the entities in the game. There are (Will be) several objects of a class in this list which extends entity. The issue here is that I want to be able to access the parseCommand method in the subclass, not in the entity …

Member Avatar
Member Avatar
+0 forum 1

The End.