473,395 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

improper pointer/integer combination: op "=" error

34
I'm creating an addrecord and a delete record for a linked list below:

Expand|Select|Wrap|Line Numbers
  1. int addRecord(struct record **start, char name[], char address[], int yearofbirth, char telno[])
  2. {
  3.     struct record *temp;
  4.     struct record *temp1;
  5.     int added;
  6.  
  7.     temp = *start;
  8.     temp1 = (struct record *)malloc(sizeof(struct record));
  9.     added = 0;
  10.  
  11.     strcpy(temp1 -> name, name);
  12.     strcpy(temp1 -> address, address);
  13.     temp1 -> yearofbirth = yearofbirth;
  14.     strcpy(temp1 -> telno, telno);
  15.     temp1 -> next = NULL;
  16.  
  17.     while(temp -> next != NULL && *start != NULL)
  18.     {
  19.         temp = temp -> next;
  20.     }
  21. ......
  22. }
The check in the while loop above for "temp -> next != NULL" passes compilation.

Expand|Select|Wrap|Line Numbers
  1. int deleteRecord(struct record **start, char name[])
  2. {
  3.     struct record *current;
  4.     struct record *previous;
  5.     struct record *temp;
  6.     int deleted;
  7.  
  8.     current = *start;
  9.     deleted = 0;
  10.  
  11.     if(*start == NULL)
  12.     {
  13.         return -1;
  14.     }
  15.  
  16.     while(current -> next =! NULL)
  17.     {
  18. ......
  19. }
But the check in this while loop throws an error: warning: improper pointer/integer combination: op "="

Here's my struct.
Expand|Select|Wrap|Line Numbers
  1. struct record
  2. {
  3.     char            name[25];
  4.     char            address[80];
  5.     int               yearofbirth;
  6.     char            telno[15];
  7.     struct record *next;
  8. };
Can't figure out why =(
Oct 16 '07 #1
2 4153
Banfa
9,065 Expert Mod 8TB
Expand|Select|Wrap|Line Numbers
  1.     while(current -> next =! NULL)
  2.  
Should be

Expand|Select|Wrap|Line Numbers
  1.     while(current -> next != NULL)
  2.  
Alternitively tell us which line the error occured on.
Oct 16 '07 #2
jthep
34
Urgh, I must have been so frustrated that my eyes must just swept pass that. Thanks...next time I will specify which line.
Oct 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Chris Mantoulidis | last post by:
I see some really weird output from this program (compiled with GCC 3.3.2 under Linux). #include <iostream> using namespace std; int main() { char *s; s = "test1"; cout << "s = " << s << "...
5
by: a R T u n | last post by:
what do you think is wrong with this? #include <iostream> int foobar (int *pi1) { *pi1 = 1024; return *pi1; }
2
by: Peter Ignarson | last post by:
Hi, simple question Is there a syntax (other than the one below that is invalid) that will let me declare and initialize two variables at the same time (using VS 2003, 1.1) ? Thank you Pete ...
4
by: Supra | last post by:
value of type "Integer" cannot be convert to system.color Public Sub APIHighlight2(ByVal BgColour As Integer, ByVal FgColour As Integer) SelectionHighlightBackColour(BgColour) Dim rtb As New...
6
by: murgan | last post by:
Hi people, i am new to this group,this is my first query, friends i want to know the difference between "function pointer" and "pointer to a function" in c lang, so friends please send the...
3
by: mattsniderppl | last post by:
Hi, I was hoping someone would know the reasons that this error is given, since i can't find any documentation explaining what causes this. I have a line of code in the onLoad function of my jsp...
2
by: Bill_DBA | last post by:
I have the following stored procedure that is called from the source of a transformation in a DTS package. The first parameter turns on PRINT debug messages. The second, when equals 1, turns on the...
1
by: pbaldridge | last post by:
I'm trying to code a simple function that will prompt a user if they want to see another set of problems. The error I receive is "ANSI C++ forbids comparison between pointer and integer" int...
20
by: chutsu | last post by:
I'm trying to compare between pointer and integer in an "IF" statement how do I make this work? if(patient.id != NULL){ } Thanks Chris
3
by: Renzr | last post by:
I have a C++ package which works very well in the 32-bit Linux-like OS. However, it will lead to a "*** glibc detected *** ./ex2: munmap_chunk(): invalid pointer" in 64-bit (Fedora 7-64), when it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.