Ok you're developing some bad habits here and I'm going to give you some advice to fix them as well as the code.
1)When debugging, try not to do random things to fix code This is especially hard for...
Type: Posts; User: mrcheesypants
Ok you're developing some bad habits here and I'm going to give you some advice to fix them as well as the code.
1)When debugging, try not to do random things to fix code This is especially hard for...
You're probably better off using just a character pointer.
char *a1 = "Available";
printf("%s\n",a1);
if(1){
a1 = "N/A";
}
printf("%s\n",a1);
Yeah you answered what I was asking. My communication skills are lacking. Thanks again for your help it has been very insightful.
Ah thanks for the info! I don't understand dynamic memory yet but wouldn't my same function cause a memory link no matter what size string s is because it looks for the '/0'? Or is the '/0' added...
Ok for exercise 5-3 in K&R (which is write a strcat function using pointers) I got
#include <stdio.h>
void stcat(char *s, char *t);
int stlength(char *s);
int main(){
char a[] =...
Odd, it looks just like that and it still crashes. My computer does act weird but I wouldn't think that it would cause a program like this to crash...
edit: Ok had to do something with projects...
Yes tried your advice and the program still crashes.
The exercise says to use a pointer string. And sorry I didn't mean crash computer I meant crash the program.
Long story short I'm on spring break and I've decided to spend my time figuring pointers out. Since I'll probably have a lot of questions on the subject I decided to make one thread and post all my...
Before you go into programming of any language read How to Design programs (free web version at www.htdp.org.) Yes, you might be anxious to code in C/C++ but trust me when I say it will make the...
I know it is not a c++ book, but it is a damn good programming book that every hobbist coder needs to read: How To Design Programs. There is a free web version www.htdp.org. (I actually got the book...
Ok guys, thanks for the help. Before I hear anymore it sounds like I should post the concepts I atleast think I understand:
Data types
Functions
Pointers, addresses and arrays (about 3/4...
Ok first of all I know you guys have been getting a bunch of "where do i startz to program my game?" threads this week so if this gets too close to that, forgive me. I am going to STFW for when I do...
If your going to get an IDE go with either Dev if your cheep like me or VS if you have some cash to spend. Since your starting out I suggest you give Dev a try and see how you like it.
Merry Christmas to all!
Heh heh that would help.... :eek:
Hi, I'm working on a blackjack program and of course I need a random card draw function. Now the problem is I don't have one, it's I need to improve it
#include <iostream>
#include <cstdlib>...
This will solve the problem you are about to have.
Thanks again Daved. I'll post here again if I have anymore problems.
Ok I have spent hours trying to debug, STFW and the forums, looked at my beginers book until finally I decided to give up and harass you guys with another array question. You see I am writing my...
So im assuming that the number I got was the memory address then?
EDIT: wait what does the "0x" mean? 0 times that hex number?
The other day I decided to start a program that solves soduku puzzles on the account that I had just learned C++ and I thought it would be a good "out of the books" exercise. While writing some...
Finally figured it out.
Bought a book called C++ GUI Programming with Qt3 by Jasmin Blanchette and Mark Summerfield and it comes with a CD that has Qt3. Prior to the installation I used Dev and since I had to install...
I know a software engineer that works for burger king....